home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 015a / pwr14j.zip / POWERBAT.DOC < prev    next >
Text File  |  1991-05-27  |  126KB  |  2,675 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.                                         PowerBatch
  22.                                        Version 1.4
  23.  
  24.  
  25.  
  26.                               COMPUTING SYSTEMS DESIGN, INC.
  27.                                      P.O. Box 566484
  28.                                Atlanta, Georgia 30356-6009
  29.                                       (404) 740-9583
  30.  
  31.  
  32.                                    _______
  33.                               ____|__     |               (tm)
  34.                            --|       |    |-------------------
  35.                              |   ____|__  |  Association of
  36.                              |  |       |_|  Shareware
  37.                              |__|   o   |    Professionals
  38.                            -----|   |   |---------------------
  39.                                 |___|___|    MEMBER
  40.  
  41.  
  42.             CSD,  Inc.   is  a   member  of   The  Association  of   Shareware
  43.             Professionals and subscribes to  all the policies and standards of
  44.             this organization.
  45.  
  46.                              Copyright (c) 1990 by CSD, Inc.
  47.                               All Rights Reserved Worldwide
  48.  
  49.                      This documentation was produced on May 27, 1991
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.                                     Table Of Contents
  58.  
  59.  
  60.            Introduction . . . . . . . . . . . . . . . . . . . . . . . . .    1
  61.  
  62.            Registration Fees And What You Get
  63.             . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .    5
  64.  
  65.            Warranty . . . . . . . . . . . . . . . . . . . . . . . . . . .    5
  66.  
  67.            Distribution Of Compiled Programs  . . . . . . . . . . . . . .    6
  68.  
  69.            Software Support . . . . . . . . . . . . . . . . . . . . . . .    6
  70.  
  71.            Concept Of Operation . . . . . . . . . . . . . . . . . . . . .    7
  72.  
  73.            Installation . . . . . . . . . . . . . . . . . . . . . . . . .    9
  74.  
  75.            Constructing A PowerBatch Source File  . . . . . . . . . . . .   11
  76.  
  77.            PowerBatch Commands  . . . . . . . . . . . . . . . . . . . . .   12
  78.  
  79.            Command Summary  . . . . . . . . . . . . . . . . . . . . . . .   40
  80.  
  81.            Compilation Errors . . . . . . . . . . . . . . . . . . . . . .   42
  82.  
  83.            Removing PowerBatch From Your System . . . . . . . . . . . . .   44
  84.  
  85.            Examples . . . . . . . . . . . . . . . . . . . . . . . . . . .   45
  86.  
  87.            Index  . . . . . . . . . . . . . . . . . . . . . . . . . . . .   48
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.             Page 1                      PowerBatch                      Page 1
  96.  
  97.                                        Introduction
  98.  
  99.             PowerBatch  is a  Shareware product.  Shareware is  a distribution
  100.             method,  not  a  type of  software.  With  Shareware you  get  the
  101.             ultimate  money-back guarantee...if you don't use the product, you
  102.             don't pay for it.
  103.  
  104.             Shareware  is not  free  software. Copyright  laws  apply  to both
  105.             Shareware  and  commercial  software,  and  the  copyright  holder
  106.             retains  all rights,  with a few specific  exceptions as stated in
  107.             this  document.  Shareware authors  are accomplished  programmers,
  108.             just like commercial authors, and the  programs are of  comparable
  109.             quality.  (In  both cases,  you will  find good  programs and  bad
  110.             ones!)  The main difference is  in the method of distribution. The
  111.             author specifically grants  the right  to copy and distribute  the
  112.             EVALUATION  VERSION  of  the software  to  anyone  as long  as  no
  113.             remuneration  is  received for  the distribution  of the  software
  114.             unless permission is granted in writing by the author.
  115.  
  116.             Shareware  distribution  gives  users a  chance  to  try  software
  117.             before  buying it.  If you  try a  Shareware program  and continue
  118.             using  it,  you are  expected to  register the  software with  the
  119.             author.  With registration, you will receive the latest version of
  120.             the  software  without the  evaluation titles  and messages.  With
  121.             shareware you  are able to try the software on  your computer with
  122.             your  own set  of peripherals,  the only  way to  know if  it will
  123.             function  in your own  environment. After deciding that PowerBatch
  124.             is a  software product that  you will  use, then and only  then do
  125.             you  pay for it.  The ultimate trust from the  author! When you do
  126.             pay for  the software,  you pay  only for  the  software, not  for
  127.             advertisement  for the software which can cost many times what the
  128.             software actually costs.
  129.  
  130.             CSD,  Inc.  is   a  member   of  the   Association  of   Shareware
  131.             Professionals  (ASP).   ASP wants to make  sure that the shareware
  132.             principle   works  for  you.  If  you  are  unable  to  resolve  a
  133.             shareware-related  problem with  an ASP  member by  contacting the
  134.             member directly,  ASP may be  able to help. The  ASP Ombudsman can
  135.             help you  resolve a  dispute or  problem with  an ASP member,  but
  136.             does  not provide technical  support for members' products. Please
  137.             write to the ASP  Ombudsman at P.O. Box  5786, Bellevue, WA  98006
  138.             or  send  a  Compuserve  message  via  easyplex to  ASP  Ombudsman
  139.             70007,3536.
  140.  
  141.             While CSD has no immediate  plans to move, businesses do move from
  142.             time  to time.  Since shareware tends  to remain on  some bulletin
  143.             boards without  update for  many  years, if  the shareware  author
  144.             does  move, you may experience a problem in contacting the author.
  145.             You  may also contact ASP  to learn of  the current address of any
  146.             ASP member if you experience this problem.
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.             Page 2                      PowerBatch                      Page 2
  155.  
  156.             Trademarks
  157.  
  158.             PowerBatch is a trademark of Computing Systems Design, Inc.
  159.             MS-DOS is a trademark of Microsoft Corporation.
  160.             IBM and PC-DOS are trademarks of IBM Corporation.
  161.             ASP, Association of  Shareware Professionals, and the ASP logo are
  162.             registered   trademarks   of   the   Association   of    Shareware
  163.             Professionals.
  164.  
  165.             License Agreement
  166.             This file  contains important  license  information regarding  the
  167.             use  of PowerBatch.  This information applies  to individual users
  168.             who wish to pass copies out to friends and associates.
  169.  
  170.             User  Groups,  Computer  Clubs,  Disk  Vendors  and  Distributors,
  171.             subscription   Services,  Disk-of-the-Month  Clubs,  etc.,  should
  172.             refer to the VENDOR.DOC file for complete  information relating to
  173.             them.
  174.  
  175.             BBS  SYSOPs  should  refer  to  the  SYSOP.DOC  file for  complete
  176.             information relating to them.
  177.  
  178.             Trial Use License
  179.  
  180.  
  181.             PowerBatch is NOT a public domain program.  It is Copyright  1990,
  182.             1991  by Computing  Systems Design, Inc. (CSD,  Inc.).  All rights
  183.             reserved.
  184.  
  185.             This software  and  accompanying  documentation are  protected  by
  186.             United  States  Copyright law  and  also by  International  Treaty
  187.             provisions.   Any  use of this software  in violation of Copyright
  188.             law or the  terms of  this limited license  will be prosecuted  to
  189.             the best of our ability.   The conditions under which you may copy
  190.             this  software and documentation  are clearly outlined below under
  191.             "Distribution Restrictions".
  192.  
  193.             Computing Systems  Design, Inc.  (CSD, Inc.)  hereby grants  you a
  194.             limited license to use this software  for evaluation purposes  for
  195.             a  period  not to  exceed  thirty  (30) days.    If you  intend to
  196.             continue  using this  software (and/or  it's  documentation) after
  197.             the  thirty  (30)   day  evaluation   period,  you  MUST  make   a
  198.             registration  payment  to Computing  Systems  Design,  Inc.  (CSD,
  199.             Inc.).
  200.  
  201.             Using this  software after the  thirty (30) day evaluation period,
  202.             without  registering the  software is a violation  of the terms of
  203.             this limited license.
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.             Page 3                      PowerBatch                      Page 3
  212.  
  213.             Licensee   shall  not  use,   copy,  rent,  lease,  sell,  modify,
  214.             decompile,  disassemble, otherwise  reverse engineer,  or transfer
  215.             the  licensed program except  as provided  in this  agreement. Any
  216.             such  unauthorized  use shall  result in  immediate and  automatic
  217.             termination of this license.
  218.  
  219.             All rights  not expressly granted  here are  reserved to Computing
  220.             Systems Design, Inc. (CSD, Inc.).
  221.  
  222.  
  223.             Limited Distribution License
  224.  
  225.  
  226.             As  the copyright holder for PowerBatch, Computing Systems Design,
  227.             Inc.  (CSD, Inc.)  authorizes distribution by  individuals only in
  228.             accordance with the following restrictions.
  229.  
  230.               (User Groups,  Computer Clubs,  Disk  Vendors and  Distributors,
  231.               Subscription  Services,  Disk-of-the-Month Clubs,  etc.,  should
  232.               refer  to the VENDOR.DOC  file for complete information relating
  233.               to them.)
  234.  
  235.               (BBS  SYSOPs  should refer  to the  SYSOP.DOC file  for complete
  236.               information relating to them.)
  237.  
  238.             Individuals  are  hereby granted  permission by  Computing Systems
  239.             Design,  Inc. (CSD,  Inc.) to  copy  the PowerBatch  diskette  for
  240.             their own  use (for evaluation  purposes) or for other individuals
  241.             to evaluate, ONLY when the following conditions are met.
  242.  
  243.             The PowerBatch package  is defined as containing all the  material
  244.             listed  in the PACKING.LST text  file.  If any files listed in the
  245.             PACKING.LST  text  file,  or  the  PACKING.LST  file  itself,  are
  246.             missing,  then the  package is  not  complete and  distribution is
  247.             forbidden.   Please contact CSD, Inc. to obtain a complete package
  248.             suitable for distribution.
  249.  
  250.               o The PowerBatch package  - including all  related program files
  251.                  and documentation files  -CANNOT be modified  in any  way and
  252.                  must   be   distributed  as   a  complete   package,  without
  253.                  exception.   The PACKING.LST text file contains a list of all
  254.                  files that are part of the PowerBatch package.
  255.  
  256.               o  No  price  or  other compensation  may  be  charged  for  the
  257.                  PowerBatch package.   A distribution cost may be charged  for
  258.                  the  cost of the diskette,  shipping and handling, as long as
  259.                  the total (per disk) does not exceed US$8.00 in  the U.S. and
  260.                  Canada, or US$12.00 internationally.
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.             Page 4                      PowerBatch                      Page 4
  269.  
  270.               o The PRINTED User's Guide  may not be reproduced in whole or in
  271.                  part,  using  any means,  without the  written permission  of
  272.                  Computing Systems Design, Inc. (CSD, Inc.).   In other words,
  273.                  the  disk-based  documentation  may  not  be  distributed  in
  274.                  PRINTED (hardcopy) form.
  275.  
  276.               o  The  PowerBatch package  cannot  be  "rented" or  "leased" to
  277.                  others.
  278.  
  279.               o  The person receiving a copy of the PowerBatch package MUST be
  280.                  made  aware that  each disk or  copy is ONLY  for evaluation,
  281.                  and that Computing Systems Design, Inc.  (CSD, Inc.) has  not
  282.                  received  any royalties  or payment  for the  product.   This
  283.                  requirement  can be met  by including the complete PowerBatch
  284.                  package,   which   contains  any   appropriate   registration
  285.                  information.
  286.  
  287.               o The person receiving a copy  of the PowerBatch package MUST be
  288.                  made  aware that he or she does not  become a registered user
  289.                  until   Computing  Systems  Design,  Inc.   (CSD,  Inc.)  has
  290.                  received  payment  for registration  of the  software.   This
  291.                  requirement  can be met  by including the complete PowerBatch
  292.                  package,   which   contains  any   appropriate   registration
  293.                  information.
  294.  
  295.               o  Computing  Systems Design,  Inc.  (CSD, Inc.)  prohibits  the
  296.                  distribution of outdated versions of  the PowerBatch package,
  297.                  without  written permission  from Computing  Systems  Design,
  298.                  Inc. (CSD, Inc.).   If the  version you  have is over  twelve
  299.                  (12)  months old,  please contact us to  ensure that you have
  300.                  the  most  current version.  This version  of PowerBatch  was
  301.                  released May 27, 1991.
  302.  
  303.               o  Licensee  shall not  use,  copy,  rent, lease,  sell, modify,
  304.                  decompile,   disassemble,  otherwise   reverse  engineer,  or
  305.                  transfer  the  licensed program  except as  provided in  this
  306.                  agreement.    Any  such  unauthorized  use  shall  result  in
  307.                  immediate and automatic termination of this license.
  308.  
  309.               o  U.S. Government Information:  Use, duplication, or disclosure
  310.                  by   the  U.S.  Government   of  the  computer  software  and
  311.                  documentation  in  this  package  shall  be  subject  to  the
  312.                  restricted rights applicable to commercial computer  software
  313.                  as  set forth  in  subdivision (b)(3)(ii)  of  the  Rights in
  314.                  Technical Data and  Computer Software clause at  252.227-7013
  315.                  (DFARS   52.227-7013).     The   Contractor/manufacturer   is
  316.                  Computing  Systems Design, Inc., P.O. Box 566484, Atlanta, GA
  317.                  30356-6009.
  318.  
  319.             All  rights not  expressly granted here are  reserved to Computing
  320.             Systems Design, Inc. (CSD, Inc.).
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.             Page 5                      PowerBatch                      Page 5
  329.  
  330.             Commercial  users   (every  user  except   individual  users)   of
  331.             PowerBatch  must register and  pay for  their copies of PowerBatch
  332.             within 30 days of first use or their license  is withdrawn.  Site-
  333.             License  and/or  dealer arrangements  may  be made  by  contacting
  334.             Computing  Systems Design,  Inc. (CSD,  Inc.). See Appendix  A for
  335.             Dealer and Site License prices.
  336.  
  337.             Anyone  distributing PowerBatch for  any kind of remuneration must
  338.             first contact  Computing Systems Design, Inc.  (CSD, Inc.) at  the
  339.             address  on the  title page for  authorization. This authorization
  340.             will  be automatically  granted to distributors  recognized by the
  341.             (ASP)  as adhering  to its guidelines  for shareware distributors,
  342.             and such distributors  may begin  offering PowerBatch  immediately
  343.             (However  Computing Systems Design, Inc. (CSD, Inc.) must still be
  344.             advised  so that  the distributor can be  kept up-to-date with the
  345.             latest version of PowerBatch.).
  346.  
  347.             To register your copy of PowerBatch, print the file  REGISTER.FRM,
  348.             complete  this form, and send  along with your registration fee to
  349.             CSD,  Inc.  You will  receive the  latest version  of the  program
  350.             along  with the latest documentation. The fully registered version
  351.             of  the program  removes all references  to evaluation. Registered
  352.             users will receive notice of  all updates made to  the program and
  353.             these  updates will be supplied  to registered users for a nominal
  354.             charge.  Every effort will be made to supply updates to registered
  355.             users at the lowest possible cost.
  356.  
  357.             If  you  need  to  submit an  invoice  to  your  accounts  payable
  358.             department,   print  the   form  INVOICE.FRM   and  fill   in  the
  359.             appropriate blanks.
  360.  
  361.             Registration Fees And What You Get
  362.  
  363.             The   evaluation  version  of  PowerBatch  contains  100%  of  the
  364.             capabilities  of   the  registered  version.  Those  who  register
  365.             PowerBatch will  receive the  latest release of  the software  and
  366.             documentation  and will  receive update  offers in  the mail  at a
  367.             minimal cost  as they  become available.  CSD maintains  copies of
  368.             innovative  batch files submitted  by users  and will  include the
  369.             best of these batch files along with the registered software.
  370.  
  371.             The  registration fee  for PowerBatch is US  $30. Price is subject
  372.             to change without notice but  will be guaranteed  through December
  373.             1990. If payment  is by check, these funds  must be drawn on a  US
  374.             bank.  Unfortunately the  processing of  non-US checks  can be  as
  375.             much as $20 and we  cannot afford this type of transaction. We are
  376.             continually   looking   for  innovative   ways  to   serve  non-US
  377.             customers.
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.             Page 6                      PowerBatch                      Page 6
  386.  
  387.             Warranty
  388.  
  389.             TRIAL USE (SHAREWARE EVALUATION VERSION) WARRANTY:
  390.  
  391.             The  Shareware evaluation  (trial use) version is  provided AS IS.
  392.             Computing  Systems Design,  Inc.  MAKES NO  WARRANTY OF  ANY KIND,
  393.             EXPRESSED   OR   IMPLIED,  INCLUDING   WITHOUT   LIMITATION,   ANY
  394.             WARRANTIES  OF MERCHANTABILITY  AND/OR  FITNESS FOR  A  PARTICULAR
  395.             PURPOSE.
  396.  
  397.             REGISTERED VERSION ONLY WARRANTY:
  398.  
  399.             Computing  Systems Design, Inc. warrants  the physical diskette(s)
  400.             and physical  documentation provided  with registered versions  to
  401.             be free of  defects in materials and  workmanship for a period  of
  402.             sixty  days from  the date of registration.   If Computing Systems
  403.             Design,  Inc. receives notification  within the warranty period of
  404.             defects  in  materials or  workmanship, and  such notification  is
  405.             determined  by  Computing  Systems Design,  Inc.  to  be  correct,
  406.             Computing   Systems  Design,  Inc.  will   replace  the  defective
  407.             diskette(s) or documentation.
  408.  
  409.             The  entire and exclusive liability  and remedy for breach of this
  410.             Limited  Warranty  shall be  limited to  replacement of  defective
  411.             diskette(s) or  documentation and shall  not include  or extend to
  412.             any  claim for  or right to  recover any other  damages, including
  413.             but not limited to, loss of profit, data, or  use of the software,
  414.             or  special, incidental, or consequential damages or other similar
  415.             claims,   even  if   Computing  Systems  Design,   Inc.  has  been
  416.             specifically  advised of  the possibility of such  damages.  In no
  417.             event  will  Computing Systems  Design, Inc.'s  liability for  any
  418.             damages  to  you or  any other  person  ever exceed  the lower  of
  419.             suggested list price  or actual price paid  for the license to use
  420.             the software, regardless of any form of the claim.
  421.  
  422.             Computing Systems  Design, Inc. SPECIFICALLY  DISCLAIMS ALL  OTHER
  423.             WARRANTIES, EXPRESS  OR IMPLIED, INCLUDING BUT NOT LIMITED TO, ANY
  424.             IMPLIED  WARRANTY   OF  MERCHANTABILITY  AND/OR   FITNESS  FOR   A
  425.             PARTICULAR PURPOSE.
  426.  
  427.             Distribution Of Compiled Programs
  428.  
  429.             REGISTERED  USERS of PowerBatch may distribute the compiled output
  430.             from  any  PowerBatch  program  written  by  the  registered  user
  431.             without any fees to CSD,  Inc. CSD recognizes that  the source and
  432.             compiled  output  are  original  works  of  the  author  and  that
  433.             PowerBatch was a  tool used in  the process of  creating the  .EXE
  434.             file.
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.             Page 7                      PowerBatch                      Page 7
  443.  
  444.             Software Support
  445.  
  446.             Support for PowerBatch may be obtained  by contacting CSD,Inc.  on
  447.             Compuserve using Compuserve Mail  (EasyPlex). Address inquiries to
  448.             Compuserve  ID 72701,155. If you  are not a Compuserve member, you
  449.             may obtain support by writing to:
  450.  
  451.                               Computing Systems Design, Inc.
  452.                                      P.O. Box 566484
  453.                                Atlanta, Georgia 30356-6009
  454.  
  455.             If  you feel  you have a  question that needs  immediate attention
  456.             and you are  a registered user, CSD's  office hours are  8AM until
  457.             5PM CST.  We will be happy to discuss any  problems or suggestions
  458.             for PowerBatch but time does not permit us to  help you debug your
  459.             PowerBatch source problems.
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.             Page 8                      PowerBatch                      Page 8
  468.  
  469.                                    Concept Of Operation
  470.  
  471.             PowerBatch  is a  compiler for batch file  "type" commands. At the
  472.             present  time there  are over  40 PowerBatch  commands which  will
  473.             work  only in a PowerBatch source file (they will not execute in a
  474.             standard  DOS batch  file). Any  valid executable  command (.EXE &
  475.             .COM) as  well as  any of  the  DOS intrinsic  commands are  valid
  476.             within  a PowerBatch  source file  and will  be  "compiled". These
  477.             .EXE,  .COM  and DOS  intrinsic commands  will be  executed via  a
  478.             shell  and  the PowerBatch  .EXE program  will continue  execution
  479.             with  the next  compiled statement following  the shelled command.
  480.             There   are   two   main   modules   supplied   with   PowerBatch;
  481.             1)POWERMAK.EXE  and  2)SMLMODEL.MDL. PowerMak  reads,  parses  the
  482.             source  file,  and compiles  the source  extracting routines  from
  483.             SmlModel.  The result  is a  completely standalone  .EXE file that
  484.             executes  without  SmlModel or  PowerMak.  The increase  in  speed
  485.             comes from  the use  of  the PowerBatch  commands as  the DOS  and
  486.             executable modules will  not be executed any faster. Most  notable
  487.             is  the  increase  in  speed  dealing  with  screen  writes.  Many
  488.             capabilities  are provided in  PowerBatch commands that simply are
  489.             not available with standard DOS commands.
  490.  
  491.                                     Why Use PowerBatch
  492.  
  493.             There  are  four major  reasons  for  using a  compiled PowerBatch
  494.             program:
  495.  
  496.                  1)  The  resulting  program  will  almost  certainly  execute
  497.                     considerably  faster.  While  it  might  be  possible   to
  498.                     construct a  compiled  PowerBatch  program that  does  not
  499.                     execute faster, it would have to consist entirely of  pre-
  500.                     existing executable modules.
  501.                  2)  PowerBatch  commands provide  a considerable  increase in
  502.                     flexibility and power over conventional batch files.
  503.                  3)  PowerBatch  programs  cannot  be changed  without  making
  504.                     machine   code   modifications.  This   means   additional
  505.                     security for distributed batch files.
  506.                  4)  PowerBatch  programs  can  be  created  quickly  for  the
  507.                     PowerBatch command set is a very high level language.
  508.  
  509.             PowerBatch commands fall into 5 classes of commands;
  510.  
  511.               1) Commands  which provide systems  information. These  commands
  512.                  provide  the current  color settings,  the current  date, the
  513.                  current  time, check  for  the  existence of  a  valid  drive
  514.                  letter,  and  commands  which check  for the  existence  of a
  515.                  directory or a file.
  516.               2) Commands  which  control  the  flow  of  the  batch  program.
  517.                  Execute  different  portions of  the batch  program based  on
  518.                  existence or non-existence  of directories or files.  Compare
  519.                  the  contents of  one variable  with the  contents of another
  520.                  variable or a constant and  execute different portions of the
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.             Page 9                      PowerBatch                      Page 9
  529.  
  530.                  batch program based on the results of the compare.
  531.               3)  Commands  which  control the  way  text  is printed  on  the
  532.                  screen.  Change any portion of the screen to any valid screen
  533.                  color,  cause a message to  blink on the screen, or highlight
  534.                  a message in reverse video.
  535.               4)  Commands which provide  string manipulation. Change a string
  536.                  to all upper case characters,  or all lower  case characters.
  537.                  Extract  a  portion  of a  string  such  as the  first  three
  538.                  characters or  the last four characters.  Build a new  string
  539.                  from  two  existing  strings  by  concatenation  of  the  two
  540.                  strings.
  541.               5)  Commands which  deal with screen writing  and input from the
  542.                  keyboard.   These  commands   are  the  main   power  in  the
  543.                  PowerBatch  system.  Directly  address  any position  on  the
  544.                  screen and move the cursor to that position to read or  write
  545.                  text. Automatically  center a message  or title  on any line.
  546.                  Draw boxes around portions  of the screen  to enhance  screen
  547.                  appearance. Read  a single  key from the  keyboard, read  the
  548.                  response  to a query that only accepts a  yes or no response,
  549.                  read  a  string  of  characters  from  the  keyboard  with  a
  550.                  specified  maximum length,  and read  keys from  the keyboard
  551.                  automatically changing the characters to upper case.
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.             Page 10                     PowerBatch                     Page 10
  560.  
  561.                                        Installation
  562.  
  563.             Installation is  accomplished by executing  the PBInstal  program.
  564.             It  seemed only  fitting that this  install program be  a compiled
  565.             PowerBatch  program. I  believe this  to be  the epitome  of self-
  566.             installing  software.  The  two  main   modules  POWERMAK.EXE  and
  567.             SMLMODEL.MDL must  be located  in the  DOS  path to  allow you  to
  568.             compile  PowerBatch programs  from any  directory on  your system.
  569.             PowerBatch  may be run  on a system  as small  as a  single floppy
  570.             drive system with 128K. There  will be some limit to the number of
  571.             source statements that  may be compiled on  a system this small as
  572.             memory  is  dynamically  allocated as  compilation  progresses.  A
  573.             source  file of  several hundred statements  can be compiled  on a
  574.             small  machine.  The PBInstal  program  is  strickly a  file  copy
  575.             program. It will  ask you where you  wish to place the  PowerBatch
  576.             files and  copy them to the specified directory. You may copy your
  577.             own files to various  directories if you desire. You may even copy
  578.             POWERMAK.EXE  and SMLMODEL.MDL to a  directory not on your path if
  579.             you desire. If you do  so, you may compile only from the directory
  580.             containing these two files.
  581.  
  582.             PowerBatch  may be  installed from  either drive  A, B, or  a hard
  583.             drive.
  584.  
  585.             If the PowerBatch source is  on a floppy disk, you may execute the
  586.             install procedure by:
  587.  
  588.               1) If your  current drive  is the  A: (or  B:) drive then  enter
  589.                  PBInstal <enter>.
  590.               2)  If you current  drive is other  than A:  (or B:)  then enter
  591.                  A:PBInstal <enter> (or B:PBInstal <enter>).
  592.  
  593.             If you are  installing PowerBatch from a  fixed disk drive such as
  594.             C:, then make the directory  which contains the  PowerBatch source
  595.             the  current default  directory.  For  example  if  you  have  the
  596.             PowerBatch  source in  a directory  named C:\TEMP,  then at  a DOS
  597.             prompt enter
  598.  
  599.             CD \TEMP <enter>
  600.             PBInstal <enter>
  601.  
  602.             You  will  first  be  asked to  enter  the  directory  name  which
  603.             contains  the PowerBatch source. Next you will be asked to enter a
  604.             directory  name on  your DOS  path where  the  PowerBatch compiler
  605.             will be  placed. POWERMAK.EXE and SMLMODEL.MDL  will be placed  in
  606.             this  directory. Before  you begin the  installation process, know
  607.             the  name of a directory which is on the DOS search path where you
  608.             will  place these  two files. The  install program will  not allow
  609.             you to  place the  compiler  in  a directory  that is  not on  the
  610.             search path.
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618.             Page 11                     PowerBatch                     Page 11
  619.  
  620.             Now  you will be asked  to enter a  directory name where you would
  621.             like  the documentation,  informational, and  example files  to be
  622.             placed. This directory does not  have to be on  your DOS path.  If
  623.             this  directory  does  not  exist,  PowerBatch  will  create  this
  624.             directory   for  you   if  you   desire.  The   documentation  and
  625.             information files will be placed in this directory.
  626.  
  627.             The  first  time that  you run  the PowerBatch  compiler, it  will
  628.             customize  itself for the computer  on which you are running. This
  629.             process  takes about  a minute and  will not run  again. Take this
  630.             opportunity  to learn about the shareware distribution process and
  631.             how  to register PowerBatch if  after taking it  for a test drive,
  632.             you  feel  you  would  like  to  add  it  to  your  collection  of
  633.             utilities.
  634.  
  635.             We  at CSD  would like  to share  innovative batch  file creations
  636.             with  our customer  base. If  you have  created such  a PowerBatch
  637.             program  and would  like to share it  with other PowerBatch users,
  638.             send  it to us and if we agree with you we  will include it on our
  639.             registration  disk  to  our customers.  You  may  mail us  a  disk
  640.             containing  the  PowerBatch  source  or  you   may  send  it   via
  641.             CompuServe EasyPlex.
  642.  
  643.             Our address is:
  644.               CSD, Inc.
  645.               P.O. Box 566484
  646.               Atlanta, GA 30356-6009
  647.  
  648.             Our CompuServe ID is 72701,155.
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.             Page 12                     PowerBatch                     Page 12
  657.  
  658.                           Constructing A PowerBatch Source File
  659.  
  660.             Use  your favorite  text editor to  create a printable  ascii file
  661.             containing   PowerBatch  source   commands  and   DOS   executable
  662.             commands.  A printable ascii file  is one that may be typed to the
  663.             screen  (ie type  myfile.pwr <enter>)  and the  results printed on
  664.             the  screen contain  only the  file  contents. Most  files created
  665.             with  a word  processor are not  printable ascii files  unless you
  666.             specify an ascii file output option.
  667.  
  668.             Compile  your  source  statements  to  create  a  .EXE  executable
  669.             module. This is done using the POWERMAK compiler. The syntax is:
  670.  
  671.                  POWERMAK MyFile [OutFile] [+M]
  672.  
  673.             PowerMake assumes  the extension of the  input file to be .PWR (ie
  674.             MYFILE.PWR)  and will  create an output  file of MYFILE.EXE  if no
  675.             OutFile  parameter is specified. The  input source file may be any
  676.             DOS name  of your  choice(including the  extension). You may  also
  677.             specify an output file name of your choice but the extension  will
  678.             always  be .EXE.  If you do not  enter the input file  name on the
  679.             command line, the  program will prompt you  for the name. You must
  680.             at this time enter the complete name including the extension.
  681.  
  682.             If you wish  to generate a  list of all  literals, variables,  and
  683.             labels  used in your PowerBatch  program, add +M to the end of the
  684.             command  line.   This  variable  map  will   be  written  to   the
  685.             POWERBAT.ERR file.
  686.  
  687.             If  you will be  running the  output from  the compilation  on any
  688.             computer that is operating under a version of DOS that is  earlier
  689.             than  DOS version 3.0, you  must enter the compiler directive +D2.
  690.             This  directive will  cause the compilation to  be much slower but
  691.             the  resulting .EXE file will  execute on computers running on DOS
  692.             3.0  and up at the SAME SPEED as compilations made without the +D2
  693.             directive. If in  doubt, use +D2.  A minute of  compile time  will
  694.             eliminate future problems.
  695.  
  696.             If the compiler finds no compilation  errors, the compiled version
  697.             of  your  source file  will be  generated. For  an explanation  of
  698.             compilation   errors,  see   the  section   entitled  "Compilation
  699.             Errors".  Compilation errors  appear  on your  screen as  they are
  700.             encountered and they  are written  to a  file named  POWERBAT.ERR.
  701.             The  entire  source  code  is scanned  each  time  you  compile  a
  702.             PowerBatch  program (ie  the compiler does not  stop when an error
  703.             is found, but attempts to identify all  errors on each pass). This
  704.             means  that  some errors  will be  the result  of previous  errors
  705.             found in the source.
  706.  
  707.             If  there are  no compilation  errors, the POWERBAT.ERR  file will
  708.             not be created.
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.             Page 13                     PowerBatch                     Page 13
  717.  
  718.                                    PowerBatch Commands
  719.  
  720.             Commands,  Variable  Names, and  Labels  are not  case  sensitive.
  721.             Everything  on the command source  line is converted to upper case
  722.             except  a literal  which is enclosed within  quotes. Either single
  723.             quotes(')  or double  quotes(") may be  used to denote  a literal.
  724.             Literals   which  are  numeric  such  as  color  values,  variable
  725.             lengths,  etc. should not be enclosed in quotes. The compiler does
  726.             evaluate  each  literal  (both alpha  and  numeric)  in  the  same
  727.             manner. The  evaluation process is  1) remove leading and trailing
  728.             quotes if any,  2) attempt  to convert literal  to numeric, 3)  if
  729.             numeric conversion  is successful,  consider it  a  number, 4)  if
  730.             numeric  conversion is  unsuccessful, consider  it  alpha numeric.
  731.             This  means that internally  an operand of 3 and  "3" will both be
  732.             numeric.
  733.  
  734.             A  semicolon which  is not enclosed within  quotes or a  part of a
  735.             command is used to denote a  comment. Semicolons which are part of
  736.             a command must not be  preceded by a space.  A comment begins with
  737.             a  semicolon which follows a space not within quotes. Comments may
  738.             appear  anywhere  on the  command  line,  but  everything after  a
  739.             semicolon on a  command line  is ignored. A  comment may begin  in
  740.             column 1 by placing the  semicolon in column 1.  The following are
  741.             NOT comments:
  742.  
  743.               path=d:\;c:\util;c:\wp
  744.               path   "d:\;c:\util;c:\wp"
  745.               WriteLine   "Punctuation may be used within quotes;"
  746.  
  747.             These ARE comments:
  748.  
  749.               Variable    ColorSave,3 ;save the original color
  750.               SetVar      Msg, ErrMsg ;set Msg to "Invalid input; re-enter"
  751.  
  752.             The starting location on the command line  of the command and  the
  753.             operands is  not important and tabs and spaces may  be freely used
  754.             for readability.
  755.  
  756.             Variable names and command  labels may be any length in the source
  757.             command   but  are  significant   only  through  the  first  eight
  758.             positions.
  759.  
  760.             Variables, Literals, and Labels
  761.  
  762.             A variable is a location  in memory that you  allocate and give  a
  763.             name and a maximum length.  Anytime you refer to the "name" of the
  764.             variable, you are referencing  the memory locations  set aside for
  765.             this  variable. Variable names give  you an easy way to manipulate
  766.             data  internally within  the computer. The  following are examples
  767.             of variables:
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.             Page 14                     PowerBatch                     Page 14
  776.  
  777.               Variable    CharIn,1
  778.                     This  variable  gives  the name  "CharIn"  to  one  memory
  779.                     position. It will be used to  hold one character responses
  780.                     from the keyboard by the user. 
  781.  
  782.               Variable    PBDir,79
  783.                     This  variable appears  in the PBInstal  program and holds
  784.                     the  name of  the directory where  the PowerBatch compiler
  785.                     will  be placed.  It is composed  of the drive  letter and
  786.                     directory   entered  by  the   user  in  response  to  two
  787.                     questions during the installation process.
  788.  
  789.               Variable    CompName,35,"The ABC Company"
  790.                     This  variable reserves  35 positions in  memory and gives
  791.                     these   locations  the   name  CompName.   The  PowerBatch
  792.                     compiler  also places the  initial value "The ABC Company"
  793.                     in  the first  15 positions of the  variable. The value of
  794.                     this variable  may be changed by  later processing in  the
  795.                     program.  When this variable  is referenced in the program
  796.                     it will contain only  15 characters (The ABC Company) with
  797.                     no  leading or  trailing spaces, assuming  the program has
  798.                     not assigned a new value.
  799.  
  800.               Variable    MsgClear,20,"                    "
  801.                     This  variable contains  20 spaces and  is named MsgClear.
  802.                     It  will be  used to "clear"  or overwrite with  spaces an
  803.                     error message in  your program. Once you have displayed  a
  804.                     message  to the user, it should be cleared as you continue
  805.                     with  the  program.  This  is  done  by  overwriting  with
  806.                     spaces.  Having  a variable  with  the correct  number  of
  807.                     spaces makes this task easier.
  808.  
  809.             There  are two  predefined variables  in each  PowerBatch program;
  810.             ERRORLEVEL  and DOSERROR. The ErrorLevel variable and the DOSError
  811.             variable are updated each  time an EXTERNAL  COMMAND is  executed.
  812.             If you execute a program  which sets an error  code on exit,  this
  813.             error  code  will  be in  ERRORLEVEL.  The  use of  ERRORLEVEL  in
  814.             PowerBatch  is equivalent  to the use of  ERRORLEVEL in a standard
  815.             DOS batch file.  If you execute  an external  command(program) and
  816.             that  command does  not terminate normally,  the variable DOSERROR
  817.             will be  set  to the  DOS error  code  assigned  by the  operating
  818.             system IF A DOS ERROR CODE WAS GENERATED BY THE OPERATING  SYSTEM.
  819.             It  is  good  practice  to  examine  the  DOSERROR  variable after
  820.             executing an external command.
  821.  
  822.             Literals are very  much like variables which  have a value  but no
  823.             name.  Literals are  used in PowerBatch commands  when you wish to
  824.             pass an actual  value to the command  instead of a variable.  Note
  825.             in  the following  examples that literals  containing numbers only
  826.             are  not  enclosed in  quotes  and  literals containing  any  non-
  827.             numeric  characters  are  enclosed  in quotes.  If  you  specify a
  828.             number  as a  literal either convention is  acceptable (3 or "3").
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.             Page 15                     PowerBatch                     Page 15
  837.  
  838.             If  you specify  alphabetic characters,  the quotes  are required.
  839.             For  readability, and ease  of entry,  numeric literals usually do
  840.             not contain quotes. Examine the following examples of literals:
  841.  
  842.               Center      "Installation Program",1
  843.                     This  command  will   center  the   literal  "Installation
  844.                     Program" on line 1 of  the screen. The  text "Installation
  845.                     Program"  must  appear somewhere  in  the program  and  it
  846.                     appears as a literal. It will occupy memory positions  and
  847.                     will  have a value but you may not reference this value by
  848.                     name.  By instructing the  compiler to write this literal,
  849.                     the  compiler automatically  creates the  memory locations
  850.                     and  initial value but gives  it no name.  The 1 is also a
  851.                     literal in this command. Each time you use a  literal in a
  852.                     PowerBatch program, the  previously assigned  literals are
  853.                     checked  for  duplication  and if  the  literal  has  been
  854.                     previously  assigned, the  prior assignment  will be  used
  855.                     (ie  literal values  will appear only  one time regardless
  856.                     of the number of times used).
  857.  
  858.               WriteAt     12,3,Msg1
  859.                     There are  two literals  in this command.  The numbers  12
  860.                     and  3 are both created  as literals. In this command they
  861.                     specify the column  and row location where the string Msg1
  862.                     will  be written.  Again, the compiler  creates the memory
  863.                     locations and values for these literals, but  no names. If
  864.                     you  were  to  write another  command  such  as  the  Beep
  865.                     command  which specifies that the system speaker will beep
  866.                     at a  certain frequency  for  3 times,  the compiler  will
  867.                     find  the  previously defined  literal  "3" and  use  this
  868.                     value instead of creating another literal.
  869.  
  870.               Beep        ErrTone,8,3
  871.                     This  is  the  Beep command  referenced  in  the  previous
  872.                     example. The beep command will cause the  speaker to sound
  873.                     at  a  frequency of  ErrTone for  .8 second  and repeat  3
  874.                     times. The  "3" literal will  use the same memory location
  875.                     reference  as  the WriteAt  command used  in the  previous
  876.                     command (ie another literal will not be created).
  877.  
  878.             Labels  are names of a particular place in your PowerBatch program
  879.             that  you will  go to without executing  the previous command. You
  880.             go  directly to this location in the program from another location
  881.             in  the program based on  a decision you have made in the program.
  882.             Examples will help explain:
  883.  
  884.               ReadYN      "Do you wish to continue [Y/N] ",InChar
  885.               Compare     InChar,"Y",,,GetDrive
  886.               Halt        999
  887.                  ;end the program if user enters "N"
  888.               Label       GetDrive
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.             Page 16                     PowerBatch                     Page 16
  897.  
  898.                     This group  of commands  writes the message on  the screen
  899.                     and asks the  user to  input either  Y or  N (the  command
  900.                     will  only accept  these two characters).  A comparison is
  901.                     then  made to  a literal "Y" and  the compare command will
  902.                     jump  to the  location in the program  named GetDrive if a
  903.                     "Y"  was entered  or will execute the  next command if "N"
  904.                     was entered.
  905.  
  906.               GoTo        NextCmd
  907.               .
  908.               .
  909.               .
  910.               Label       NextCmd
  911.  
  912.                     In this most  straightforward use  of the label, the  user
  913.                     simply  uses the GoTo command and jumps unconditionally to
  914.                     another point in the program.
  915.  
  916.             External  commands  are entered  just as  PowerBatch commands  are
  917.             entered.  If you  enter an external command  and this command uses
  918.             command line parameters, these parameters may  be passed as either
  919.             variables  or literals.  Remember that  if  the parameter  is  not
  920.             numeric, it must be enclosed in quotes or it will be  treated as a
  921.             variable.  Any PowerBatch  statement which is  an external command
  922.             may contain a maximum of  7 command line variables. That is not to
  923.             say  that you may not  pass more than 7 command line parameters to
  924.             an  external program but that these command line variables may not
  925.             be contained in more that 7 PowerBatch variables.
  926.  
  927.             For example:
  928.               Variable Parm1,5,"one"
  929.               Variable Parm2,5,"two"
  930.               Variable Parm3,5,"three"
  931.               Variable Parm4,5,"four"
  932.               Variable Parm5,5,"five"
  933.               Variable Parm6,5,"six"
  934.               Variable Parm7,5,"seven"
  935.               Variable Parm8,5,"eight"
  936.               Variable BigParm,80
  937.             ;ExtPgm will have the last parm truncated
  938.               ExtPgm   Parm1,Parm2,Parm3,Parm4,Parm5,Parm6,Parm7,Parm8
  939.             ;valid method for passing these parms (1 PowerBatch parm)
  940.               Extpgm   "one two three four five six seven eight"
  941.             ;accomplishing the same thing with variables (6 PowerBatch parms)
  942.               Concat   BigParm,Parm1," "
  943.               Concat   BigParm,Parm2
  944.               Concat   BigParm," "
  945.               Concat   BigParm,Parm3
  946.               ExtPgm   BigParm,Parm4,Parm5,Parm6,Parm7,Parm8
  947.  
  948.             Examples of external programs as PowerBatch commands: 
  949.  
  950.  
  951.  
  952.  
  953.  
  954.  
  955.  
  956.             Page 17                     PowerBatch                     Page 17
  957.  
  958.               Variable    InChar,1
  959.               ReadYN      "Do you wish a directory ",InChar
  960.               Compare     InChar,"Y",NextSec,NextSec
  961.               DIR         "/W"
  962.               SETUP       "> null"    ;printer redirection
  963.  
  964.               Variable    PgmName,12
  965.               Write       "Enter the name of the program to compile "
  966.               ReadStr     PgmName
  967.               TPC         PgmName, "/ddebug"
  968.  
  969.             This  third example of external  commands show the  use of the two
  970.             predefined   variables,  ERRORLEVEL   and  DOSERROR.   After   the
  971.             execution  of  "TestPgm",  we  examine DOSError  to  find  if  the
  972.             program  executed OK (Possibly there  was not enough memory or the
  973.             program  could not  be found on  the DOS path).  After determining
  974.             that the  program executed  OK, we  examine the  exit code set  by
  975.             "TestPgm"  to determine  the flow  of the  remainder of  our batch
  976.             file. This exit code will be found in the variable ERRORLEVEL.
  977.  
  978.               Variable    MsgLine,80
  979.               .
  980.               .
  981.               TestPgm     "Parm1 Parm2"
  982.               Compare     DOSError,0,,,RanOK
  983.               WriteLine   "TestPgm did not execute properly...terminating"
  984.               Halt        DOSError
  985.               Label       RanOK
  986.               Compare     ErrorLevel,1,Chk2,,Option1
  987.               Concat      MsgLine,"Unexpected return code of ",ErrorLevel
  988.               Halt
  989.               Label       Option1
  990.  
  991.             Note:  PowerBatch  programs may  be executed  by other  PowerBatch
  992.             programs as external commands.  An option of  the PowerBatch  Halt
  993.             command  is  to  set the  DOS  errorlevel.  You could  then  "pass
  994.             parameters"  from  one  PowerBatch  program  to  another  via  the
  995.             ERRORLEVEL variable.
  996.  
  997.  
  998.  
  999.  
  1000.  
  1001.  
  1002.  
  1003.             Page 18                     PowerBatch                     Page 18
  1004.  
  1005.             Command line  parameters may  be passed  to a compiled  PowerBatch
  1006.             program. These command line  parameters must be defined at compile
  1007.             time and  have special variable names. Up to 16  parameters may be
  1008.             passed  to  a  PowerBatch program  and  their  names are  CLP%1  -
  1009.             CLP%16.
  1010.             If you  wish  to  pass  parameters on  the  command line  to  your
  1011.             PowerBatch program,  define the  command line parameter  variables
  1012.             (CLP%1 - CLP%16) in  your PowerBatch source  prior to  compilation
  1013.             and  when you run the  compiled program, any parameters entered on
  1014.             the command line will be in the defined variable. Example:
  1015.  
  1016.               Source for SMARTCPY.PWR
  1017.  
  1018.               Variable    CLP%1,79    ;source file
  1019.               Variable    CLP%2,79    ;target file
  1020.               Variable    InChar,1
  1021.               ReadYN      "Shall I copy the files for you [Y/N] ",InChar
  1022.               Compare     InChar,"Y",NoCopy,NoCopy
  1023.               COPY        CLP%1, CLP%2
  1024.  
  1025.               SMARTCPY  FILE1 FILE2 will execute the DOS copy command and copy
  1026.             FILE1 to FILE2 if the user responds Y to the question.
  1027.  
  1028.             Changes To Your Computer's Environment Area
  1029.  
  1030.             Your  computer memory contains a special area of memory called the
  1031.             "Environment  Area".  This special  area  of memory  contains  the
  1032.             values  assigned  to  variables  that  are available  to  the  DOS
  1033.             operating system  or to  any application  program running  in your
  1034.             computer.   These  values   remain  unchanged  until   DOS  or  an
  1035.             application program  changes them as  long as the  power is on  to
  1036.             your  computer. DOS  maintains special  values in this  area which
  1037.             the operating system  uses. Your  current path and current  prompt
  1038.             configuration are two of these  values. These values  are normally
  1039.             set  with  the  DOS PROMPT  or  PATH  command. If  an  application
  1040.             program   like  a  compiled  PowerBatch  program  executes  a  DOS
  1041.             command, it is done via  a "shell" or another copy of your command
  1042.             processor  (normally COMMAND.COM)  which is started  to handle the
  1043.             execution  of these  DOS commands.  When a  shell is  started, DOS
  1044.             creates a  copy of  the environment  area for  this new  shell and
  1045.             makes   the   environment   values   available   to   the   shell.
  1046.             Unfortunately, when the  shell is terminated (when the DOS command
  1047.             is  complete) this copy of  the environment is erased from memory.
  1048.             If you execute  a PROMPT, PATH or SET [Variable] command, the copy
  1049.             of the environment created for  the shell to run the PROMPT, PATH,
  1050.             or  SET  command  is  updated  and  immediately  erased  when  the
  1051.             PowerBatch  program is finished.  PowerBatch however, provides you
  1052.             a means to update both the permanent copy and  the current copy of
  1053.             the  environment  area  with the  commands  SETPATH,  SETENV,  and
  1054.             PROMPT.
  1055.  
  1056.             Unfortunately,  problems dealing with  the environment area do not
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.  
  1064.             Page 19                     PowerBatch                     Page 19
  1065.  
  1066.             end  here. When  DOS runs  a program  (like a  PowerBatch compiled
  1067.             program), a copy of the permanent environment  is made and is  the
  1068.             "active" environment  area  in  use  during  the  running  of  the
  1069.             program.  If you  only read  the  values of  existing  environment
  1070.             variables,  there  is  no  problem. If  you  attempt  to  add  new
  1071.             environment values, the  amount of free  environment space is very
  1072.             limited.  IT IS NOT THE  AMOUNT OF SPACE  ALLOCATED BY YOU IN YOUR
  1073.             CONFIG.SYS  FILE (or the default)  MINUS THE AMOUNT OF USED SPACE!
  1074.             The amount  of "free"  space appears to  be only  the amount  left
  1075.             after  rounding  up  the  amount of  used  space  to  the  nearest
  1076.             paragraph of memory (16 bytes).
  1077.             The   problem  of   allocating  environment  free   space  can  be
  1078.             circumvented by  updating  the  permanent  environment  area  with
  1079.             dummy  values prior to the execution of your PowerBatch file. This
  1080.             could  be  done  with a  small  PowerBatch  program such  as  ENV-
  1081.             INIT.PWR as follows:
  1082.  
  1083.               SetEnv   Env1,'dummy value dummy value'
  1084.               SetEnv   Env2,'dummy value dummy value'
  1085.               .
  1086.               .
  1087.               .
  1088.             When  ENV-INIT terminates, the environment variables Env1 and Env2
  1089.             will  have  the  dummy  values and  will  now  be  a  part  of any
  1090.             environment  area copy  passed to a running  program. You could of
  1091.             course  use the  DOS SET  command  from the  DOS command  line  or
  1092.             initialize  the environment  variables with  dummy values  in your
  1093.             AUTOEXEC.BAT file.
  1094.  
  1095.             Command Notation
  1096.             In  the description  of  the  commands which  follow,  that  which
  1097.             appears  within brackets  [ ] is  optional and all  other operands
  1098.             are required.  Any  time  a screen  color may  be  specified in  a
  1099.             command such as
  1100.  
  1101.               CLEARLINE LineNumber,ForegroundColor,BackgroundColor
  1102.  
  1103.             the  single attribute which is  used in many color conventions may
  1104.             be substituted  for the  pair of  color  attributes. For  example,
  1105.             foreground color 4 (red), background color 1 (blue), is  identical
  1106.             to  color attribute 20 and  the CLEARLINE command may be specified
  1107.             EITHER as 
  1108.  
  1109.               CLEARLINE 14,4,1
  1110.             or
  1111.               CLEARLINE 14,20
  1112.  
  1113.             to  clear  line  14 on  the  screen  to  red  foreground  on  blue
  1114.             background.  For this  reason anytime  that  the operand  pair  of
  1115.             foreground  color, background color  is required, the single color
  1116.             attribute  may be substituted for  the pair. The compiler will not
  1117.             detect  missing background  color attributes but  will assume that
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.             Page 20                     PowerBatch                     Page 20
  1126.  
  1127.             the foreground is the composite value.
  1128.  
  1129.             How do  I  calculate this  color  attribute?  The composite  color
  1130.             attribute  is the  operating systems  shorthand method  of keeping
  1131.             both  the foreground and background  colors in one byte of memory.
  1132.             It  may be  calculated by multiplying  the background color  by 16
  1133.             and  adding the  foreground color. See  Appendix B for  a complete
  1134.             list of composite color attributes.
  1135.             Color Attribute = (Background X 16) + Foreground
  1136.             RedOnBlue = (1 X 16) + 4 = 20
  1137.             WhiteOnBlack = (0 X 16) + 7 = 7
  1138.             YellowOnRed = (4 X 16) + 14 = 78
  1139.             This  uses  the ascii  values 0  through  127  for all  the colors
  1140.             available. To make any color blink, add 128 to the color value.
  1141.             YellowOnRed,Blinking = 78 + 128 = 206.
  1142.  
  1143.             Command Syntax
  1144.  
  1145.             Several  examples  are available  on  the distribution  disk.  All
  1146.             source  code  examples  have  a  file  extension  of  .PWR.  These
  1147.             examples  may be edited with your favorite text editor and printed
  1148.             by  "copying" the  file to the  printer such as  COPY PBINSTAL.PWR
  1149.             LPT1.
  1150.  
  1151.                     ==================================================
  1152.  
  1153.  
  1154.             ?COLOR        VarName1, VarName2, VarName3
  1155.                  Retrieve  the current  color attributes  from the  system and
  1156.                     place  the  current  foreground  color  in  VarName1,  the
  1157.                     current background  color in VarName2,  and the  composite
  1158.                     attribute  in VarName3.  See Appendix B  for complete list
  1159.                     of composite color attributes.
  1160.  
  1161.                  Ex:   Variable ForeColor,3
  1162.                        Variable BackColor,3
  1163.                        Variable ColorAttr,3
  1164.                        ?Color   ForeColor,BackColor,ColorAttr
  1165.  
  1166.                     Retrieve the current foreground, background and  composite
  1167.                        color  values  and place  in  the  variables ForeColor,
  1168.                        BackColor,   and  ColorAttr   respectively.  To  create
  1169.                        professional batch files it is  a good idea to retrieve
  1170.                        the  current color setting as the first  command in the
  1171.                        program and reset these values and clear the screen  at
  1172.                        the  end  of  your program.  This  restores  the  users
  1173.                        computer  to the same  color state  that you found when
  1174.                        your PowerBatch program was executed.
  1175.  
  1176.                     ==================================================
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.             Page 21                     PowerBatch                     Page 21
  1185.  
  1186.             ?CURRDIR      VarName1, VarName2
  1187.                  Retrieve the current drive  and directory from the system and
  1188.                     place  the  current  drive in  VarName1  and  the  current
  1189.                     directory  in VarName2. The  contents of VarName1 prior to
  1190.                     execution  of this command  control which currently logged
  1191.                     drive  is searched for  the currently logged directory. If
  1192.                     ?CurrDir finds a valid drive  letter in the first position
  1193.                     of VarName1,  then the contents  of VarName2  will be  the
  1194.                     currently  logged directory  of that  drive. If  the first
  1195.                     position  of  VarName1  does not  contain  a  valid  drive
  1196.                     letter, then  VarName2 will  contain the  currently logged
  1197.                     directory  of the  current drive. In  either case VarName1
  1198.                     will  contain  the drive  and  VarName2 will  contain  the
  1199.                     directory.
  1200.  
  1201.                  Ex:   Variable    CurrDrive,2
  1202.                        Variable    CurrDir,79
  1203.                        SetVar      CurrDrive,"A"
  1204.                        ?CurrDir    CurrDrive,CurrDir
  1205.                        SetVar      CurrDrive,""
  1206.                        ?CurrDir    CurrDrive,CurrDir
  1207.  
  1208.                  In  the first usage  of ?CurrDir, assuming that the currently
  1209.                     logged  directory on  the A  drive is  the root directory,
  1210.                     CurrDrive  will contain  "A" and CurrDir  will contain "\"
  1211.                     after  the  execution of  ?CurrDir. In  the second  usage,
  1212.                     assuming that  the currently  logged drive is  D: and  the
  1213.                     currently   logged   directory   on   the  D:   drive   is
  1214.                     "\UTIL\EXEC", CurrDrive will contain "D" and CurrDir  will
  1215.                     contain "\UTIL\EXEC" after the execution of ?CurrDir.
  1216.  
  1217.                     ==================================================
  1218.  
  1219.             ?DATE         VarName1, VarName2, VarName3, VarName4
  1220.                  Retrieve  the current date from  the system and place the day
  1221.                     of  the week  in VarName1, the month  in VarName2, the day
  1222.                     in VarName3,  and the year in VarName4. VarName1 should be
  1223.                     defined  as 9  long, VarName2 and VarName3  as 2 long, and
  1224.                     VarName4 as 4 long.
  1225.  
  1226.                  Ex:   Variable DOW,9
  1227.                        Variable Mo,2
  1228.                        Variable Da,2
  1229.                        Variable Yr,4
  1230.                        ?Date    DOW,Mo,Da,Yr
  1231.  
  1232.                     Retrieve  the current  date and place  the component parts
  1233.                        in  their respective  variables. Place  the day  of the
  1234.                        week  in DOW (ie Saturday),  the month number in Mo (ie
  1235.                        06),  the day of the  month in Da (ie 29), and the year
  1236.                        in Yr (ie 1990).
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.             Page 22                     PowerBatch                     Page 22
  1245.  
  1246.                     ==================================================
  1247.  
  1248.             ?DIREXIST     VarName1, Label1 [,Label2]
  1249.                           Literal1,Label1 [,Label2]
  1250.                  Check  the system  for the  existence of the  directory whose
  1251.                     name appears in  VarName1 or in Literal1. If the directory
  1252.                     exists jump  to the command  immediately following Label1,
  1253.                     if  the directory  does  not exist,  jump  to  the command
  1254.                     immediately following Label2.
  1255.  
  1256.                  Ex:   ?DirExist   InpStr,DirOk,BadDir
  1257.                        ?DirExist   "C:\",DirOK,BadDir
  1258.                        ?DirExist   InpStr,,BadDir (next command if exists)
  1259.                        ?DirExist   InpStr,DirOk   (next command if not exist)
  1260.                  In  the first example if  the contents of the variable InpStr
  1261.                     exists then  goto label DirOK, if  it does not exist go to
  1262.                     the  label BadDir. In the  second example we check for the
  1263.                     existence  of  a literal  with a  value of  "C:\". In  the
  1264.                     third example,  if the  contents of InpStr exist  we "fall
  1265.                     through"  to the  next instruction, if  the directory does
  1266.                     not  exist  we jump  to the  label BadDir.  In the  fourth
  1267.                     example, if the  directory name in InpStr exists, we  jump
  1268.                     to the label DirOK, if  it does not exist  we fall through
  1269.                     to the next command.
  1270.  
  1271.                     ==================================================
  1272.  
  1273.             ?DISKSPACE    VarName1, VarName2, VarName3
  1274.                           Literal1, VarName1, VarName2
  1275.                  Query the  disk Drive  specified by  the  first character  of
  1276.                     Varname1 and  place the  total disk capacity  in bytes  in
  1277.                     VarName2  and  the unused  bytes  in VarName3.  Since  the
  1278.                     command looks at  only the first character of VarName1 (or
  1279.                     Literal1),   VarName1  may   contains  strings   such   as
  1280.                     "C:\UTIL".
  1281.  
  1282.                  Ex:   Variable    DirName,79
  1283.                        ReadStr     DirName  (user enters "c:\util")
  1284.                        Upper       DirName  (changes to "C:\UTIL")
  1285.                        ?DiskSpace  DirName,TotSpace,FreSpace
  1286.  
  1287.                     This  will place  the total  capacity of  drive C:  in the
  1288.                        variable TotSpace and the amount  of this space that is
  1289.                        unused in the variable FreSpace.
  1290.  
  1291.                        ?DiskSpace  "A",TotSpace,FreSpace
  1292.                     This accomplishes the same task using a literal of "A".
  1293.  
  1294.  
  1295.  
  1296.  
  1297.  
  1298.  
  1299.  
  1300.             Page 23                     PowerBatch                     Page 23
  1301.  
  1302.  
  1303.                     ==================================================
  1304.  
  1305.             ?DRIVEEXIST   VarName1, Label1 [,Label2]
  1306.                           Literal1, Label1 [,Label2]
  1307.                  Check  the system  for VarName1 as  a valid drive  letter. If
  1308.                     the  drive  is  valid, jump  to  the  command  immediately
  1309.                     following  Label1, if  the drive is not  valid jump to the
  1310.                     command immediately following Label2.
  1311.  
  1312.                  Ex:   ?DriveExist DrvNum,GoodDrv,BadDrv
  1313.                        ?DriveExist "A",GoodDrv,BadDrv
  1314.                        ?DriveExist DrvNum,,BadDrv
  1315.                        ?DriveExist DrvNum,GoodDrv
  1316.  
  1317.                     ==================================================
  1318.  
  1319.             ?ENVSTR       VarName1, VarName2
  1320.                           Literal1, VarName2
  1321.                  Retrieve  the contents  of any environment  variable from the
  1322.                     system  environment  area.  The  name of  the  environment
  1323.                     variable is  placed in  VarName1 or entered  as a  literal
  1324.                     and  the  contents of  the  environment variable  will  be
  1325.                     placed  in VarName2. Ensure that VarName2 has been defined
  1326.                     sufficiently  long enough  to contain the  contents of the
  1327.                     environment  variable. If VarName2 is not long enough, the
  1328.                     environment  variable will  be truncated.  To  display the
  1329.                     currently  defined  environment  variables,  use  the  DOS
  1330.                     "SET" command  at a  DOS prompt.  (ie C:>SET  <enter>) You
  1331.                     should   receive  at   least  two   environment  variables
  1332.                     (assuming   you  have   set  a   path)  with   the  format
  1333.                     NAME=VALUE.  The location of  your command processor is in
  1334.                     an  environment  variable named  COMSPEC  and should  look
  1335.                     something like this: COMSPEC=C:\COMMAND.COM.
  1336.  
  1337.                  Ex:   Variable    EnvValue,255
  1338.                        Variable    EnvName,4,"path"
  1339.                        ?EnvStr     "prompt", EnvValue
  1340.                        ?EnvStr     EnvName, EnvValue
  1341.  
  1342.                     ==================================================
  1343.  
  1344.  
  1345.  
  1346.  
  1347.  
  1348.  
  1349.  
  1350.             Page 24                     PowerBatch                     Page 24
  1351.  
  1352.  
  1353.             ?FILEEXIST    VarName1, Label1 [,Label2]
  1354.                           Literal, Label1 [,Label2]
  1355.                  Check  the system  for the specified  file name. If  the file
  1356.                     exists,  jump to the command immediately following Label1,
  1357.                     if  the  file   does  not  exist,   jump  to  the  command
  1358.                     immediately following Label2.
  1359.  
  1360.                  Ex:   ?FileExist  FileName, Label1, Label2
  1361.                        ?FileExist  "C:\AUTOEXEC.BAT",StartOK,NoStart
  1362.                        ?FileExist  FileName,,Label2
  1363.                        ?FileExist  FileName,Label1
  1364.  
  1365.                     ==================================================
  1366.  
  1367.             ?INPATH       VarName1, Label1 [,Label2]
  1368.                           Literal1, Label2 [,Label2]
  1369.  
  1370.                  Compare the  contents of VarName1  to the system search path.
  1371.                     If  VarName1 is  contained  within  the path  jump to  the
  1372.                     command immediately  following  Label1, if  the file  does
  1373.                     not  exist  jump  to  the  command  immediately  following
  1374.                     Label2.  Use this  command to determine if  a directory is
  1375.                     specified in the DOS search path.
  1376.  
  1377.                  Ex:   DOS search path contains "C:\UTIL;C:\WORDPROC;D:\"
  1378.                        Variable    InString,79
  1379.                        Write       "Enter your directory name "
  1380.                        ReadStr     InString (user enters "c:\wordproc")
  1381.                        Upper       InString (change to "C:\WORDPROC")
  1382.                        ?InPath     InString,PathOK,BadPath
  1383.  
  1384.                        ?InPath     "C:\UTIL",,BadPath   (compare literal)
  1385.  
  1386.                     ==================================================
  1387.  
  1388.             ?TIME         VarName1
  1389.                  Retrieve the  current  time  from  the system  and  place  in
  1390.                     VarName1. The format of the time  is hh:mm:ss xm. VarName1
  1391.                     should be defined as 11 long.
  1392.                  Ex:   Variable CurrTime,11
  1393.                        ?Time    CurrTime (now contains 11:24:14 am)
  1394.  
  1395.  
  1396.  
  1397.  
  1398.  
  1399.  
  1400.  
  1401.             Page 25                     PowerBatch                     Page 25
  1402.  
  1403.  
  1404.                     ==================================================
  1405.  
  1406.             ADD        VarName1,VarName2
  1407.                        VarName1,Literal2
  1408.  
  1409.                  Add the  contents of VarName2  (or Literal2)  to VarName1 and
  1410.                     place the result in VarName1.
  1411.  
  1412.                  Ex:   Variable    YLoc,2
  1413.                     SetVar         YLoc,6
  1414.                     Label          LoopCtr
  1415.                     ClearLine      YLoc,Blue
  1416.                     Add            YLoc,1
  1417.                     Compare        YLoc,11,LoopCtr
  1418.  
  1419.                  This  small code  segment will  clear lines  6 through  10 on
  1420.                     your  screen by incrementing the line number variable used
  1421.                     by the ClearLine command.
  1422.  
  1423.                     ==================================================
  1424.  
  1425.             BEEP          VarName1, VarName2, VarName3
  1426.                           Literal1, Literal2, Literal3
  1427.  
  1428.                  Sound  the system speaker with a tone  of VarName1 frequency,
  1429.                     for  a length  of VarName2 tenths of  a second, and repeat
  1430.                     VarName3 times.
  1431.  
  1432.                  Ex:   Beep  800,5,3
  1433.                        Beep  ErrFreq,BeepLen,ErrTimes
  1434.                     The  first example sound the system speaker at a frequency
  1435.                        of 800 hz  for half a second (.5) and repeats twice for
  1436.                        a  total of 3 times.  The second example will sound the
  1437.                        system speaker at a frequency equal to  the contents of
  1438.                        the  variable ErrFreq for BeepLen tenths of a second(s)
  1439.                        for a total of ErrTimes.
  1440.  
  1441.                     ==================================================
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.             Page 26                     PowerBatch                     Page 26
  1450.  
  1451.  
  1452.             BLINK
  1453.  
  1454.                  Cause all text that  is written to the screen to blink  using
  1455.                     the   current  color   attributes  last  defined   in  the
  1456.                     processing  of the batch program. This command in "undone"
  1457.                     by using NORMAL.
  1458.  
  1459.                  Ex:   Variable MsgClear,25."                         "
  1460.                        Blink
  1461.                        WriteAt  15,4,"Not a valid entry"
  1462.                        Normal
  1463.                        Wait     35
  1464.                        WriteAt  15,4,MsgClear
  1465.  
  1466.                     Write the  message "Not a valid entry" at column 15 on row
  1467.                        4  using the  current color definition.  Reset the text
  1468.                        color  to  the  value  it  contained  before specifying
  1469.                        blinking text. Wait 3.5 seconds and clear the message.
  1470.  
  1471.                     ==================================================
  1472.  
  1473.             BOOT
  1474.                  This  command will  cause  the computer  to perform  a "warm"
  1475.                     boot.  This emulates the  pressing of the Alt-Ctrl-Del key
  1476.                     combination.
  1477.  
  1478.                     ==================================================
  1479.  
  1480.  
  1481.             BOX1          VarNm1, VarNm2, VarNm3, VarNm4, VarNm5 [,VarNm6]
  1482.                           Lit1, Lit2, Lit3, Lit4, Lit5 [,Lit6]
  1483.                  Draw  a  box  (frame) on  the  screen  whose upper  left  co-
  1484.                     ordinates  (X,Y) are VarNm1, VarNm2, and whose lower right
  1485.                     co_ordinates  (X,Y) are VarNm3, VarNm4. Draw the box using
  1486.                     a  line  in foreground  color VarNm5  on background  color
  1487.                     VarNm6.  The  box  is drawn  using a  single  line border.
  1488.                     Companion  commands Box2, Box3,  and Box4 draw boxes using
  1489.                     a double line, a  solid line, and  a single line box  with
  1490.                     shadow.
  1491.  
  1492.                  Ex:   Variable ULX,2,5     ;upper left col value
  1493.                        Variable ULY,2,3     ;upper left row value
  1494.                        Variable LRX,2,75    ;lower right col value
  1495.                        Variable LRY,2,20    ;lower right row value
  1496.                        Variable BoxFore,2,4 ;foreground color red
  1497.                        Variable BoxBack,2,0 ;background color black
  1498.                        Box1  ULX, ULY, LRX, LRY, BoxFore, BoxBack
  1499.                        Box1  5,3,75,20,7,0
  1500.                        Box1  5,3,75,20,112
  1501.  
  1502.                     The  first  example  draws  a  box  whose  upper  left co-
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.             Page 27                     PowerBatch                     Page 27
  1511.  
  1512.                        ordinates  are the  contents of  the variables  ULX and
  1513.                        ULY  and whose lower left co-ordinates are the contents
  1514.                        of  the variables  LRX and LRY. The  box border will be
  1515.                        the  contents  of  BoxFore (red)  on  a  background  of
  1516.                        BoxBack  (black).  The  interior of  the  box  will  be
  1517.                        unchanged  (ie  it  is  not cleared  nor  is  the color
  1518.                        changed).  The second  example draws a  box whose upper
  1519.                        left  co-ordinates are  5,3 and  whose lower  right co-
  1520.                        ordinates are 75,20.  The box border is drawn in  white
  1521.                        on  black. The third example  draws a box with the same
  1522.                        co-ordinates and uses the  composite color attribute of
  1523.                        112 (white on black). See ClearBox command.
  1524.  
  1525.                     ==================================================
  1526.  
  1527.             BREAKON
  1528.                  Provides a capability to  exit from a  PowerBatch program  by
  1529.                     pressing  the  combination  of  keys  (Ctrl  -  Break)  or
  1530.                     (Ctrl - C). The default value set at  the beginning of any
  1531.                     PowerBatch  program  is  BreakON.  To  keep  a  user  from
  1532.                     exiting   a  running   PowerBatch  program,   execute  the
  1533.                     BreakOFF command.  If sections  of the program  are to  be
  1534.                     protected  and other  sections not,  surround the sections
  1535.                     with pairs of BreakON...BreakOFF commands.
  1536.  
  1537.                     ==================================================
  1538.  
  1539.             BREAKOFF
  1540.                  Disables   the  ability  to  stop  a  PowerBatch  program  by
  1541.                     pressing   the  (Ctrl  -   Break)  or   (Ctrl  -   C)  key
  1542.                     combinations.  The default  value set at  the beginning of
  1543.                     any PowerBatch program is BreakON.
  1544.  
  1545.                     ==================================================
  1546.  
  1547.             CENTER        VarName1, VarName2
  1548.                           Literal1, Literal2
  1549.                  Center the text in VarName1 on line VarName2.
  1550.  
  1551.                  Ex:   Variable InpStr,25,"PowerBatch"
  1552.                        Center   "PowerBatch",2
  1553.                        Center   InpStr,2
  1554.  
  1555.                     Both  versions  of  this  example  will  center  the  name
  1556.                        "PowerBatch" on line 2 of the screen.
  1557.  
  1558.                     ==================================================
  1559.  
  1560.  
  1561.  
  1562.  
  1563.  
  1564.  
  1565.  
  1566.             Page 28                     PowerBatch                     Page 28
  1567.  
  1568.  
  1569.             CLEAR         VarName1 [,VarName2]
  1570.                           Literal1 [,Literal2]
  1571.  
  1572.                  Clear  the  entire screen  to foreground  color VarName1  and
  1573.                     background color VarName2.
  1574.  
  1575.                  Ex:   Variable ColorAttr,3,112   ;define white on black
  1576.                        Clear    4,1
  1577.                        Clear    112
  1578.                        Clear    ColorAttr
  1579.                     The  first example  clears the screen to  red on blue. The
  1580.                        second and third examples clear the screen to white  on
  1581.                        black.
  1582.  
  1583.                     ==================================================
  1584.  
  1585.             CLEARBOX      VarNm1, VarNm2, VarNm3, VarNm4, VarNm5 [,VarNm6]
  1586.                           Lit1, Lit2, Lit3, Lit4, Lit5 [,Lit6]
  1587.  
  1588.                  Clear the interior of the box  whose upper left  co-ordinates
  1589.                     (X,Y)  are  VarNm1,  VarNm2  and  whose  lower  right  co-
  1590.                     ordinates  (X,Y) are VarNm3, VarNm4. Clear the interior of
  1591.                     the  box to  foreground color VarNm5  and background color
  1592.                     VarNm6. This command clears the  "inside" of the  box, not
  1593.                     the lines which describe the box.
  1594.  
  1595.                  Ex:   Variable ULX,2,5     ;upper left col value
  1596.                        Variable ULY,2,3     ;upper left row value
  1597.                        Variable LRX,2,75    ;lower right col value
  1598.                        Variable LRY,2,20    ;lower right row value
  1599.                        Variable BoxFore,2,4 ;foreground color red
  1600.                        Variable BoxBack,2,0 ;background color black
  1601.                        Box1     ULX, ULY, LRX, LRY, BoxFore, BoxBack
  1602.                        ClearBox 5,3,75,20,112
  1603.  
  1604.                     In  this example we define  the upper right and lower left
  1605.                        co-ordinates of the box  as well as  the colors BoxFore
  1606.                        and BoxBack.  We draw  the  box with  a red  line on  a
  1607.                        black  background.  The  ClearBox  command  clears  the
  1608.                        interior of the box to white on black.
  1609.  
  1610.                     ==================================================
  1611.  
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.             Page 29                     PowerBatch                     Page 29
  1619.  
  1620.  
  1621.             CLEARLINE     VarName1, VarName2 [,VarName3]
  1622.                           Literal1, literal2 [,Literal3]
  1623.                  Clear the line  number specified by VarName1 to a  foreground
  1624.                     color of VarName2 and a background color of VarName3.
  1625.  
  1626.                  Ex:   Variable    Red,1,4
  1627.                        Variable    Blue,1,1
  1628.                        Variable    RedOnBlue,2,20
  1629.                        Variable    CurrLine,2,12
  1630.                        ClearLine   12,Red,Blue
  1631.                        ClearLine   CurrLine,RedOnBlue
  1632.  
  1633.                     Both  examples of  the ClearLine command clear  line 12 on
  1634.                        the  screen to red foreground color and blue background
  1635.                        color.
  1636.  
  1637.                     ==================================================
  1638.  
  1639.             COLOR         VarName1 [,VarName2]
  1640.                           Literal1 [,Literal2]
  1641.                  Set  the  default  color to  foreground  color  VarName1  and
  1642.                     background  color VarName2  or optionally  set the default
  1643.                     color attribute to VarName1.
  1644.                  Ex:   Variable RedOnBlue,2,20
  1645.                        Color    4,1
  1646.                        Color    MenuClr
  1647.  
  1648.                     Both  examples set  the default color  to red on  blue for
  1649.                        any  text written to  the screen without specific color
  1650.                        instructions.
  1651.  
  1652.                     ==================================================
  1653.  
  1654.  
  1655.  
  1656.  
  1657.  
  1658.  
  1659.  
  1660.             Page 30                     PowerBatch                     Page 30
  1661.  
  1662.  
  1663.             COMPARE    VarName1, VarName2, Label1 [,Label2] [,Label3]
  1664.                        Literal1, Literal2, Label1 [,Label2] [,Label3]
  1665.                  Compare   the  contents  of   VarName1  to  the  contents  of
  1666.                     VarName2.  If VarName1  greater than VarName2  jump to the
  1667.                     statement   following  Label1.   If  VarName1   less  than
  1668.                     VarName2  jump  to  the  statement  following  Label2.  If
  1669.                     VarName1 equal  VarName2 jump to  the statement  following
  1670.                     Label3.   If  the  contents  of  the  first  two  operands
  1671.                     (VarName1, VarName2,  Literal1, or  Literal2) are  numeric
  1672.                     then  a   numeric  compare   is  performed   otherwise  an
  1673.                     alphabetic   compare   is  made.   (If   19  is   compared
  1674.                     alphabetically to 2, then 2 is greater  than 19; if it  is
  1675.                     compared numerically, 19 is greater than 2.)
  1676.  
  1677.                  Ex:   Variable InChar,1
  1678.                        Variable Yes,1,"Y"
  1679.                        Variable No,1,"N"
  1680.                        GoToXY   4,23
  1681.                        ReadYN   "Incorrect entry...Continue [Y/N] "
  1682.                        Compare  InChar,"Y",NoIn,NoIn,YesIn
  1683.  
  1684.                        Compare  InChar,Yes,,,YesIn   (Not Y falls through)
  1685.  
  1686.                        Compare  InChar,"Y",NoIn,NoIn (Y falls through)
  1687.  
  1688.                     In  the  first example  of the  Compare command,  variable
  1689.                        InChar  is  compared  to  literal  "Y".  If  InChar  is
  1690.                        greater than  "Y" then  the  program will  jump to  the
  1691.                        label  NoIn; if InChar  is less  than "Y",  the program
  1692.                        also  jumps to  the label NoIn;  if InChar is  equal to
  1693.                        "Y",  the program will continue processing at the label
  1694.                        named   YesIn.  In  the  second  compare  command,  the
  1695.                        variable  InChar is compared  to the variable Yes which
  1696.                        has an assigned value  of "Y". If  the variable  InChar
  1697.                        contains anything but  "Y", the program continues  with
  1698.                        the  next instruction after  the compare command (it is
  1699.                        said  to  fall through);  if InChar  contains "Y",  the
  1700.                        program will  jump to  the label  YesIn.  In the  third
  1701.                        compare  command,  variable InChar  is compared  to the
  1702.                        literal  "Y".  If  the  variable  InChar  contains  "N"
  1703.                        (ReadYN  prevents any  entry  but Y  or N)  the program
  1704.                        jumps  to the  label NoIn  otherwise it  continues with
  1705.                        the instruction after the compare command.
  1706.  
  1707.                     ==================================================
  1708.  
  1709.  
  1710.  
  1711.  
  1712.  
  1713.  
  1714.  
  1715.             Page 31                     PowerBatch                     Page 31
  1716.  
  1717.  
  1718.             CONCAT     VarName1, VarName2 [,VarName3]
  1719.                        VarName1, Literal1 [,Literal2]
  1720.                  Concatenate  the  string  in  VarName2  with  the  string  in
  1721.                     VarName3  and place the result in VarName1. If VarName3 is
  1722.                     not  present then concatenate  the string in VarName1 with
  1723.                     the string in VarName2 and place the result in VarName1.
  1724.                  Ex:   Variable    OutMsg,78
  1725.                        Variable    ErrMsg," is not a valid Drive letter."
  1726.                        Variable    DriveLtr,1
  1727.                        WriteAt     6,17,"Enter your source drive letter "
  1728.                        ReadUpKey   DriveLtr
  1729.                        ?DriveExist DriveLtr,DriveOK
  1730.                        Concat      OutMsg, "[19] ", DriveLtr
  1731.                        Concat      OutMsg, " is not a valid Drive letter."
  1732.                        WriteAt     5,23,OutMsg
  1733.  
  1734.                     In this example  we ask the  user to  input a valid  drive
  1735.                        letter  and  verify  this drive  with  the  ?DriveExist
  1736.                        command.  If  the drive  is  not valid  we  concatenate
  1737.                        "[19]"  (the   error  number)  plus  the  drive  letter
  1738.                        entered by the  user into the variable OutMsg. We  then
  1739.                        concatenate  the error message  (" is not a valid Drive
  1740.                        letter.")  onto  the contents  of  OutMsg.  The  result
  1741.                        would  be something  like "[19] L is  not a valid Drive
  1742.                        letter."
  1743.  
  1744.                     ==================================================
  1745.  
  1746.             GOTO       Label1
  1747.  
  1748.                  Jump to the statement identified as command label Label1.
  1749.                  Ex:   GoTo  Error
  1750.                        GoTo  EndOfPgm
  1751.  
  1752.                     ==================================================
  1753.  
  1754.             GOTOXY     VarName1, VarName2
  1755.                        Literal1, Literal2
  1756.  
  1757.                  Move  the cursor to the  column (X) specified in VarName1 and
  1758.                     row (Y) specified in VarName2.
  1759.                  Ex:   Variable CurrX,2
  1760.                        Variable CurrY,2
  1761.                        GoToXY   CurrX, CurrY
  1762.                        GoToXY   12,6
  1763.  
  1764.                     In  the first example the  cursor is moved to the location
  1765.                        specified  by the contents of variable CurrX and CurrY.
  1766.                        In  the  second example,  the cursor  is  moved to  the
  1767.                        location specified by two literals "12" and "6".
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.             Page 32                     PowerBatch                     Page 32
  1776.  
  1777.                     ==================================================
  1778.  
  1779.             HALT       VarName1
  1780.                        Literal1
  1781.                  Halt  the  batch file  processing and  set DOS  errorlevel to
  1782.                     VarName1.
  1783.                  Ex:   Variable Error14,2,14   ;define Error14 as "14"
  1784.                        Halt     99
  1785.                        Halt     Error14
  1786.  
  1787.                     In the  first usage  of the  Halt command,  the PowerBatch
  1788.                        program  is halted and the DOS errorlevel is set to 99.
  1789.                        In  the second usage the  program is halted and the DOS
  1790.                        errorlevel  is set to  the contents of variable Error14
  1791.                        ("14").
  1792.  
  1793.                     ==================================================
  1794.  
  1795.             LABEL      LabelName
  1796.  
  1797.                  Define  a location  in the list of  commands that will enable
  1798.                     execution  to  begin immediately  following  this  command
  1799.                     without    necessarily   having   executed   the   command
  1800.                     immediately  prior to the  Label. Jump immediately to this
  1801.                     location  in  the command  stream. See  the discussion  on
  1802.                     labels at the beginning of this section.
  1803.  
  1804.                  Ex:   Label    MatchErr
  1805.                        Label    EndOfPgm
  1806.  
  1807.                     ==================================================
  1808.  
  1809.             LENGTH     VarName1, VarName2
  1810.                        VarName1, Literal1
  1811.  
  1812.                  Calculate the length  of the string in variable VarName2  and
  1813.                     place the result in VarName1.
  1814.                  Ex:   Variable InString
  1815.                        Variable StrLen
  1816.                        WriteAt  12,14,"Enter your current directory "
  1817.                        ReadStr  InString (user enters c:\util)
  1818.                        Length   StrLen, InString  (StrLen will contain 7)
  1819.  
  1820.                     ==================================================
  1821.  
  1822.             LOWER      VarName1
  1823.  
  1824.                  Change the alphabetic characters in VarName1 to lower case.
  1825.                  Ex:   Variable InString,25
  1826.                        ReadStr  InString (user enters C:\UTIL)
  1827.                        Lower    InString (now contains c:\util)
  1828.  
  1829.  
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.             Page 33                     PowerBatch                     Page 33
  1836.  
  1837.                     ==================================================
  1838.  
  1839.             MIDSTRING  VarName1, VarName2, VarName3, VarName4
  1840.                        VarName1, Literal1, Literal2, Literal3
  1841.  
  1842.                  Extract  a substring of VarName2 beginning at offset VarName3
  1843.                     into  VarName2 for  a length  of  VarName4 and  place this
  1844.                     substring in VarName1.
  1845.  
  1846.                  Ex:   Variable Path,79
  1847.                        WriteAt     1,2,"Enter Drive and Directory name "
  1848.                        ReadStr     Path  (user enters C:\UTIL)
  1849.                        MidString   Drive,Path,1,2 (extract C: from C:\UTIL)
  1850.  
  1851.                     ==================================================
  1852.  
  1853.             NORMAL
  1854.  
  1855.                  Change  the current color attribute(s) back to the definition
  1856.                     prior to the execution of a BLINK or REVERSE command.
  1857.  
  1858.                  Ex:   Color    20    ;set default color to red on blue
  1859.                        Blink          ;changes to blinking red on blue (148)
  1860.                        WriteAt  2,24,"Incorrect...re-enter!"
  1861.                        Normal         ;resets color to 20
  1862.                        Beep     800,8
  1863.                        Wait     35    ;pause 3.5 seconds
  1864.                        WriteAt  2,24,"                    "   ;clear msg
  1865.  
  1866.                     This  is an example of  a typical error routine. The color
  1867.                        attribute  is  changed  to  blinking  with  the   Blink
  1868.                        command.  The error  message is  written and  the color
  1869.                        attribute  is changed  back to its  original value with
  1870.                        the  Normal command. The  speaker is "beeped" and after
  1871.                        a wait  of 3.5 seconds,  the error  message is  removed
  1872.                        from the screen.
  1873.  
  1874.                     ==================================================
  1875.  
  1876.             PROMPT     VarName1
  1877.                        Literal1
  1878.                  Change  the  current   value  of  the  prompt  to  the  value
  1879.                     specified in VarName1 or in Literal1.
  1880.  
  1881.                  Ex: Prompt     "$p$g"
  1882.  
  1883.                    ================================================== 
  1884.  
  1885.             READKEY    VarName1,VarName2
  1886.  
  1887.                  Read a single key from the  keyboard and place the  result in
  1888.                     VarName1. If  VarName 2 contains  a "1"  after reading the
  1889.  
  1890.  
  1891.  
  1892.  
  1893.  
  1894.  
  1895.  
  1896.             Page 34                     PowerBatch                     Page 34
  1897.  
  1898.                     key  from  the  keyboard, then  a "special  key"  has been
  1899.                     returned in  VarName1.  Special  keys are  function  keys,
  1900.                     Page  Up/Down, cursor movement  keys, etc.  If you  are in
  1901.                     doubt  about  a particular  key, run  the program  "KEYID"
  1902.                     (furnished  on the install  disk). Each key you press will
  1903.                     be  identified as  either a regular  key or a  special key
  1904.                     and  the value that will be returned in VarName1 when this
  1905.                     key is pressed (remember that VarName2 will  contain a "1"
  1906.                     for special keys).
  1907.  
  1908.                  Ex:   Variable CharIn,1
  1909.                        GoToXY   1,14
  1910.                        Write    "Enter the drive letter for output ",4,1
  1911.                        ReadKey  CharIn
  1912.  
  1913.                     Variable    SpecChar,1  ;for special char indicator
  1914.                     Variable    UpArrow,1,"H" ;value for Up arrow if special
  1915.                     Variable    CtlF5,1,#98 ;value for Ctrl-F5
  1916.                     ReadKey     CharIn,SpecChar
  1917.                     ;compare the character in CharIn to the value of UpArrow
  1918.                     Compare     CharIn,UpArrow,NotUp,NotUp
  1919.                     ;until we look at SpecChar, it could be UpArrow or "H"
  1920.                     Compare     SpecChar,"1",,,NotAlpha
  1921.                     Write       "You entered H" ;SpecChar not equal 1
  1922.                     GoTo        Cont
  1923.                     Label       NotAlpha
  1924.                     Write       "You entered Up arrow" ;SpecChar equal 1
  1925.  
  1926.                     ==================================================
  1927.  
  1928.             READSTR    VarName1
  1929.  
  1930.                  Read  a string of characters from the keyboard until the user
  1931.                     presses the enter  key. Any  number of  characters may  be
  1932.                     read up to the  maximum length specified  for VarName1  in
  1933.                     the Variable statement.
  1934.  
  1935.                  Ex:   Variable    InString,12
  1936.                        ReadStr     InString    (12 chars max will be read)
  1937.  
  1938.                     ==================================================
  1939.  
  1940.             READUPKEY  VarName1
  1941.  
  1942.                  Read a single character from the keyboard, changing the  case
  1943.                     of any  alphabetic character to  upper case and place this
  1944.                     upper case character in VarName1.
  1945.  
  1946.                  Ex:   ReadUpKey   CharIn
  1947.  
  1948.                     ==================================================
  1949.  
  1950.  
  1951.  
  1952.  
  1953.  
  1954.  
  1955.  
  1956.             Page 35                     PowerBatch                     Page 35
  1957.  
  1958.  
  1959.             READYN     VarName1, VarName2
  1960.                        Literal1, VarName2
  1961.  
  1962.                  Write  the message  found in  VarName1 at the  current cursor
  1963.                     location and wait for  a single key to be entered from the
  1964.                     keyboard. Force the user to enter  either a "Y" or "N" and
  1965.                     place the upper case "Y" or "N" in VarName2.
  1966.  
  1967.                  Ex:   Variable    Msg4,35,"Invalid name...Continue [Y/N] "
  1968.                        ReadYN      "Invalid name...Continue [Y/N] ",CharIn
  1969.  
  1970.                        ReadYN      Msg4,CharIn
  1971.  
  1972.                  In both usages  of the  ReadYN command, the message  "Invalid
  1973.                     filename...Continue [Y/N]  "  will  be displayed  and  the
  1974.                     program  will wait  for a response  from the user.  If the
  1975.                     user enters  any characters other than  "Y", "y", "N",  or
  1976.                     "n"  the  system  speaker  will  sound  and  the  user  is
  1977.                     prompted  again  for  input. At  the  completion  of  this
  1978.                     command,  the variable  CharIn will contain  either "Y" or
  1979.                     "N" (always upper case).
  1980.  
  1981.                     ==================================================
  1982.  
  1983.             REVERSE
  1984.                  Change  the  text  attributes to  "reverse  video".  This  is
  1985.                     accomplished  by swapping  the foreground  and  background
  1986.                     attributes. This command is "undone" by using NORMAL.
  1987.  
  1988.                  Ex:   Color    20    ;red on black
  1989.                        Reverse        ;color is changed to black on red
  1990.                        WriteAt  1,15,"Press Escape To Continue"
  1991.                        Normal         ;color is now red on black
  1992.  
  1993.                     ==================================================
  1994.  
  1995.             SETENV     VarName1, VarName2
  1996.                        Literal1, Literal2
  1997.                  Set  the  value  of the  environment  variable  specified  in
  1998.                     VarName1  or Literal1  to the value  specified in VarName2
  1999.                     or Literal2.
  2000.  
  2001.                  Ex: Variable   VarName,7,"MONITOR"
  2002.                     Variable    VarValue,5,"color"
  2003.                     SetEnv      VarName, VarValue
  2004.                     SetEnv      "Monitor","color"
  2005.  
  2006.                     ==================================================
  2007.  
  2008.  
  2009.  
  2010.  
  2011.  
  2012.  
  2013.  
  2014.             Page 36                     PowerBatch                     Page 36
  2015.  
  2016.  
  2017.             SETPATH    VarName1
  2018.                        Literal1
  2019.                  Set  the current  path to the value  specified in VarName1 or
  2020.                     the value specified in Literal1.
  2021.  
  2022.                  Ex:   Variable
  2023.             NewPath,40,"d:\;c:\util\exec;c:\wp\letters;c:\dos"
  2024.                     SetPath  NewPath
  2025.                     SetPath  "d:\;c:\;"
  2026.  
  2027.                     ==================================================
  2028.  
  2029.             SETVAR     VarName1, VarName2
  2030.                        VarName1, Literal1
  2031.  
  2032.                  Set the value of VarName1 to the contents of VarName2.
  2033.  
  2034.                  Ex:   Variable ErrCode,3
  2035.                        Variable FileName,79
  2036.                        SetVar   ErrCode,99
  2037.                        SetVar   FileName,"C:\CONFIG.SYS"
  2038.  
  2039.                     In  the first  usage of  the SetVar  command, the variable
  2040.                        ErrCode  is set  to "99" and the  second usage sets the
  2041.                        variable FileName to "C:\CONFIG.SYS"
  2042.  
  2043.                     ==================================================
  2044.  
  2045.             SUBTRACT   VarName1,VarName2
  2046.                        VarName1,Literal2
  2047.  
  2048.                  Subtract  the  contents of  VarName2 (or  Literal2) from  the
  2049.                     contents of VarName1 and place the result in Varname 1.
  2050.  
  2051.                     ==================================================
  2052.  
  2053.             UPPER      VarName1
  2054.  
  2055.                  Change the alphabetic characters in VarName1 to upper case.
  2056.  
  2057.                  Ex:   Variable InString,25
  2058.                        WriteAt  14,25,"Enter your directory name "
  2059.                        ReadStr  InString    (user enters c:\util)
  2060.                        Upper    InString    (changed to C:\UTIL)
  2061.                        ?InPath  InString,GoodDir  (path is always upper case)
  2062.  
  2063.                     In this example, the  user is prompted for a path name  to
  2064.                        be  entered. The  path name  is to  be compared  to the
  2065.                        system  path for  validity. Since  the contents  of the
  2066.                        system  path are  always in  upper case,  we change the
  2067.                        InString variable to upper case prior to comparison.
  2068.  
  2069.  
  2070.  
  2071.  
  2072.  
  2073.  
  2074.  
  2075.             Page 37                     PowerBatch                     Page 37
  2076.  
  2077.  
  2078.                     ==================================================
  2079.  
  2080.             VARIABLE   VariableName, MaxLength [,InitialValue]
  2081.  
  2082.                  Define  a variable  to  PowerBatch. All  variables used  in a
  2083.                     PowerBatch  program must have been defined with a VARIABLE
  2084.                     command.  VariableName is the name which you  give to this
  2085.                     variable  and the means by which you refer to the variable
  2086.                     in other PowerBatch statements. This variable may  contain
  2087.                     any  number of  characters up to  MaxLength and is  set to
  2088.                     the initial value of InitialValue. The  initial value of a
  2089.                     variable  may be assigned by means of the decimal value of
  2090.                     the  ascii  character. To  define the  initial value  of a
  2091.                     variable using the  ascii value, precede  the value with #
  2092.                     (see  example below).  See the discussion  on variables at
  2093.                     the beginning of this section.
  2094.                  Command  line  parameters  passed  to  a  compiled PowerBatch
  2095.                     program must  be defined  as variables.  Up to 16  command
  2096.                     line  variables  may be  passed to  a compiled  PowerBatch
  2097.                     program  and they  are defined  as CLP%1..CLP%16.  See the
  2098.                     example MOVE1 or MOVE2.
  2099.  
  2100.                  Ex:   Variable    DayOfWeek,9
  2101.                        Variable    ErrMsg1,25,"Invalid directory name."
  2102.                        Variable    InString,80,""
  2103.                        Variable    PauseTime,2,50
  2104.                        Variable    RightArrow,1,#26
  2105.                        Variable    DblLine,5,#205#205#205#205#205
  2106.                        Variable    CLP%1,12       (command line parameter %1)
  2107.  
  2108.                     ==================================================
  2109.  
  2110.             WAIT       VarName1
  2111.                        Literal1
  2112.  
  2113.                  Cause the  execution  of a  PowerBatch program  to pause  for
  2114.                     VarName1 tenths of a second(s).
  2115.  
  2116.                  Ex:   Wait        5           (pause half a second)
  2117.                        Wait        PauseTime   (pause 5 seconds)
  2118.  
  2119.                     ==================================================
  2120.  
  2121.  
  2122.  
  2123.  
  2124.  
  2125.  
  2126.  
  2127.             Page 38                     PowerBatch                     Page 38
  2128.  
  2129.  
  2130.             WRITE      VarName1, VarName2 [,VarName3]
  2131.                        Literal1, Literal2 [,Literal3]
  2132.  
  2133.                  Write  the string contained in VarName1 at the current cursor
  2134.                     location  using color  attributes foreground  VarName2 and
  2135.                     background  VarName3.  In  the  absence  of  VarName2  and
  2136.                     VarName3  use the current  color attributes. The string is
  2137.                     not  followed by a carriage return, line feed pair (ie the
  2138.                     cursor  is not  moved to  the first  position of  the next
  2139.                     line).
  2140.  
  2141.                  SEE SPECIAL NOTE BELOW ON IMBEDDED COLOR COMMANDS.
  2142.  
  2143.                  Ex:   Write    "Enter your password ",0,7
  2144.                        Variable ErrMsg1,25,"Invalid directory name."
  2145.                        Variable ErrClr,3,112
  2146.                        Write    ErrMsg1,ErrClr
  2147.  
  2148.                     ==================================================
  2149.  
  2150.             WRITEAT    VarName1, VarName2, VarName3 [,VarName4] [,VarName5]
  2151.                        Literal1, Literal2, Literal3 [,Literal4] [,Literal5]
  2152.  
  2153.                  Write   the  string  contained  in  VarName3  at  column  (X)
  2154.                     contained  in VarName1  and row (Y)  contained in VarName2
  2155.                     using   the  foreground   color  attribute   contained  in
  2156.                     VarName4 and  the background color  attribute contained in
  2157.                     VarName5.  In the  absence of  VarName4 and  VarName5, use
  2158.                     the current color  attributes. The  string is not followed
  2159.                     by  a carriage  return, line feed  pair (ie the  cursor is
  2160.                     not moved to the first position of the next line).
  2161.  
  2162.                  SEE SPECIAL NOTE BELOW ON IMBEDDED COLOR COMMANDS.
  2163.  
  2164.                  Ex:   Variable TitleClr,3,112
  2165.                        Variable CurrX,2
  2166.                        Variable CurrY,2
  2167.                        Variable CompName,25,"The ABC Company"
  2168.                        WriteAt  15,3,"The ABC Company",TitleClr
  2169.                        WriteAt  CurrX,CurrY,CompName
  2170.  
  2171.                     In  the first  usage of  the  WriteAt command  the literal
  2172.                        "The  ABC Company"  is written at column  15, row 3. In
  2173.                        the  second  usage,   the  contents  of  the   variable
  2174.                        CompName  ("The ABC Company")  is written at the column
  2175.                        location  specified by  the contents of  variable CurrX
  2176.                        and at the  row location specified  by the  contents of
  2177.                        variable CurrY.
  2178.  
  2179.                     ==================================================
  2180.  
  2181.  
  2182.  
  2183.  
  2184.  
  2185.  
  2186.  
  2187.             Page 39                     PowerBatch                     Page 39
  2188.  
  2189.  
  2190.             WRITELINE  VarName1 [,VarName2]
  2191.  
  2192.                  Write  the string contained in VarName1 beginning in location
  2193.                     1  of the  line number  specified in VarName2.  Follow the
  2194.                     string  with a carriage return line feed pair (ie move the
  2195.                     cursor  to the  first position of  the next line).  In the
  2196.                     absence  of  VarName2  write the  string  at  the  current
  2197.                     cursor location.
  2198.  
  2199.                  SEE SPECIAL NOTE BELOW ON IMBEDDED COLOR COMMANDS.
  2200.  
  2201.                  Ex:   WriteLine   "Please read these instructions ",7
  2202.                        WriteLine   Msg5
  2203.  
  2204.                     In the first usage of  WriteLine the message  "Please read
  2205.                        these  instructions " is  written beginning in column 1
  2206.                        of  row  7. In  the second  usage the  contents of  the
  2207.                        variable  Msg5  is  written beginning  at  the  current
  2208.                        cursor  location. In both cases a carriage return, line
  2209.                        feed  (position  cursor at  the first  position of  the
  2210.                        next line) is written.
  2211.  
  2212.  
  2213.  
  2214.  
  2215.  
  2216.  
  2217.  
  2218.             Page 40                     PowerBatch                     Page 40
  2219.  
  2220.  
  2221.             IMBEDDED COLOR COMMANDS
  2222.  
  2223.             A literal or  a variable may be  defined which has color  commands
  2224.             imbedded in  the text  of the literal  allowing you to  change the
  2225.             color  in the  middle of  the string  to be  printed. If  you were
  2226.             creating a tutorial and wanted  a menu at the bottom of the screen
  2227.             that  gave the  user several command  choices and you  wanted this
  2228.             menu  to  have the  first  character of  each  command in  reverse
  2229.             video,  PowerBatch  provides a  means to  accomplish this  easily.
  2230.             Suppose the command line is:
  2231.               Next Previous Load ........
  2232.             and the N, P, and  L were to be in  reverse video you would define
  2233.             the variable (or literal) as:
  2234.  
  2235.               Variable Cmd,75,"@112N@007ext @112P@007revious @112L@007oad"
  2236.  
  2237.             IN  THIS EXAMPLE THE @ REPRESENTS CTRL-A BECAUSE YOUR PRINTER WILL
  2238.             NOT PRINT A CTRL-A!
  2239.  
  2240.             The  syntax for imbedded color  commands is Ctrl-A followed by the
  2241.             THREE  digit color attribute. Thus  @112 means change the color to
  2242.             color  112  and continue  printing  in  this color  until  another
  2243.             change is  made. Further examining  the line...@112N@007ext  means
  2244.             change  to color  112, print  N, change  to color  007,  print ext
  2245.             (Next).
  2246.  
  2247.             The  ascii value of  Ctrl-A is  001. Most text  editors will allow
  2248.             you  to  enter an  ascii character  by entering  the actual  ascii
  2249.             value by pressing the Alt key and entering the  ascii value on the
  2250.             numeric  keypad (not  the numbers  above the  character keyboard).
  2251.             Thus entering Ctrl-A becomes as simple as pressing Alt-1.
  2252.  
  2253.             See Appendix B for a complete list of composite color attributes.
  2254.  
  2255.  
  2256.  
  2257.  
  2258.  
  2259.  
  2260.  
  2261.             Page 41                     PowerBatch                     Page 41
  2262.  
  2263.                                      Command Summary
  2264.  
  2265.             ?COLOR        Var1, Var2, Var3 
  2266.             ?CURRDIR      Var1, Var2
  2267.             ?DATE         Var1, Var2, Var3, Var4
  2268.             ?DIREXIST     Var1, Lab1 [,Lab2]  or Lit1, Lab1 [,Lab2]
  2269.             ?DISKSPACE    Var1, Var2, Var3
  2270.             ?DRIVEEXIST   Var1, Lab1 [,Lab2] or Lit1, Lab1 [,Lab2]
  2271.             ?ENVSTR       Var1, Var2 or Lit1, Var2
  2272.             ?FILEEXIST    Var1, Lab1 [,Lab2] or Lit1, Lab1 [,Lab2]
  2273.             ?INPATH       Var1, Lab1 [,Lab2] or Lit1, Lab1 [,Lab2]
  2274.             ?TIME         Var1
  2275.             ADD           Var1,Var2 or Var1, Lit2
  2276.             BEEP          Var1, Var2, Var3 or Lit1, Lit2, Lit3
  2277.             BLINK
  2278.             BOOT
  2279.             BOX1          Var1, Var2, Var3, Var4, Var5 [,V6] or Lit1, Lit2,
  2280.                           Lit3, Lit4, Lit5, [,Lit6]
  2281.             BREAKON
  2282.             BREAKOFF
  2283.             CENTER        Var1, Var2 or Lit1, Lit2
  2284.             CLEAR         Var1 [,Var2] or Lit1 [,Lit2]
  2285.             CLEARBOX      Var1, Var2, Var3, Var4, Var5 [,V6] or Lit1, Lit2,
  2286.                           Lit3, Lit4, Lit5 [,Lit6]
  2287.             CLEARLINE     Var1, Var2 [,Var3] or Lit1, Lit2, Lit3
  2288.             COLOR         Var1 [,Var2] or Lit1 [,Lit2]
  2289.             COMPARE       Var1, Var2, Lab1 [,Lab2] [,Lab3] or Lit1, Lit2,
  2290.                           Lab1 [,Lab2] [,Lab3]
  2291.             CONCAT        Var1, Var2 [,Var3] or Var1, Lit2 [,Lit3]
  2292.             GOTO          Lab1
  2293.             HALT          Var1 or Lit1
  2294.             LENGTH        Var1, Var2 or Var1, Lit1
  2295.             LOWER         Var1 
  2296.             MIDSTRING     Var1, Var2, Var3, Var4 or Var1, Var2, Lit1, Lit2
  2297.             NORMAL
  2298.             PROMPT        Var1 or Lit1
  2299.             READKEY       Var1,Var2
  2300.             READSTR       Var1
  2301.             READUPKEY     Var1
  2302.             READYN        Var1, Var2 or Lit1, Var1
  2303.             REVERSE
  2304.             SETENV        Var1, Var2 or Lit1, Lit2
  2305.             SETPATH       Var1 or Lit1
  2306.             SETVAR        Var1, Var2 or Var1, Lit1
  2307.             SUBTRACT      Var1, Var2 or Var1, Lit1
  2308.             UPPER         Var1
  2309.             VARIABLE      VariableName, MaxLength [,InitialValue]
  2310.             WAIT          Var1 or Lit1
  2311.             WRITE         Var1, Var2 [,Var3] or Lit1, Lit2 [,Lit2]
  2312.             WRITEAT       Var1, Var2, Var3 [,Var4] [,Var5] or Lit1, Lit2,
  2313.                           Lit3, [,Lit4] [,Lit5]
  2314.             WRITELINE     Var1 [,Var2] or Lit1 [,Lit2]
  2315.  
  2316.  
  2317.  
  2318.  
  2319.  
  2320.  
  2321.  
  2322.             Page 42                     PowerBatch                     Page 42
  2323.  
  2324.             ERRORLEVEL    Predefined variable containing the value of the
  2325.                           exit code set by the previous program or command.
  2326.  
  2327.             DOSERROR      Predefined variable containing the last set value
  2328.                           of the operating system error code.
  2329.  
  2330.  
  2331.  
  2332.  
  2333.  
  2334.  
  2335.  
  2336.             Page 43                     PowerBatch                     Page 43
  2337.  
  2338.                                     Compilation Errors
  2339.  
  2340.             Compilation  errors are printed on  the screen and also written in
  2341.             a  file named  POWERBAT.ERR (If  you have  a split  screen editor,
  2342.             view  the source  in one screen part  and the errors  in the other
  2343.             part).  If  the  source line  is  available,  the source  line  is
  2344.             printed  above the error preceded by the line number count. Source
  2345.             lines  are not  available during the  second pass of  the compiler
  2346.             which may generate "Label not defined" and "Variable not  defined"
  2347.             errors.
  2348.  
  2349.               "Not a valid command" -  This error is generated  when the first
  2350.                  word  on the  command line  is not  a PowerBatch  command and
  2351.                  contains more than 8 characters.
  2352.  
  2353.                  Example:
  2354.                     13 Directory name checked here.
  2355.                     [DIRECTORY] Not a valid command
  2356.  
  2357.                     Probably should be ;Directory name checked here
  2358.  
  2359.               "Missing variable" -  A command contains less than the  required
  2360.                  number of operands.
  2361.  
  2362.                  Example:
  2363.                     21 ?Color   ForeColor,BackColor
  2364.                     [] Missing variable
  2365.  
  2366.                     Variable for the composite color byte is missing.
  2367.  
  2368.               "Expected a variable  Name" - A string  was found in an  operand
  2369.                  that may contain only a variable name.
  2370.  
  2371.                  Example:
  2372.                     10 ?Time "Current Time"
  2373.                     [Current Time] Expected a variable name
  2374.  
  2375.                     The current time may only be placed in a variable.
  2376.  
  2377.               "Quoted   literal  not   terminated"  -   A  single   quote  was
  2378.                  encountered within a source line.
  2379.  
  2380.                  Example:
  2381.                     9 Center "Move Command,5
  2382.                     [] Quoted literal not terminated
  2383.  
  2384.                     Closing quote should precede comma.
  2385.  
  2386.  
  2387.  
  2388.  
  2389.  
  2390.  
  2391.  
  2392.             Page 44                     PowerBatch                     Page 44
  2393.  
  2394.               "Invalid  max  length  specified"  -  The second  operand  of  a
  2395.                  variable  definition should specify the maximum length of the
  2396.                  variable. The value found was not numeric.
  2397.  
  2398.                  Example:
  2399.                     3 Variable  CompName,"The ABC Company"
  2400.                     [The ABC Company] Invalid max length specified
  2401.  
  2402.               "Variable not defined" -  A reference to a variable was made  in
  2403.                  the  source file  but the variable  was not defined  with the
  2404.                  Variable command.
  2405.  
  2406.                  Example:
  2407.                     [CURRDATE] Variable not defined
  2408.  
  2409.               "Duplicate  variable" - The same variable name has appeared 2 or
  2410.                  more times in a Variable definition statement.
  2411.  
  2412.                  Example:
  2413.                     7 Variable  CompName,25
  2414.                     [COMPNAME] Duplicate variable
  2415.  
  2416.               "Duplicate label" - The same  label name has appeared  2 or more
  2417.                  times in a Label definition statement.
  2418.  
  2419.                  Example:
  2420.                     16 Label    Step2
  2421.                     [STEP2] Duplicate label
  2422.  
  2423.               "Invalid  hex definition  in variable"  - A  variable definition
  2424.                  contained  a #  not enclosed  in  quotes signifying  a  value
  2425.                  definition  by ascii  value. The characters  following this #
  2426.                  were not numeric or did not equate to an ascii character.
  2427.  
  2428.                  Example:
  2429.                     Variable Return,2,#J#219
  2430.  
  2431.                     #J is not valid
  2432.  
  2433.               "External  command >" - This  is not an  error message, but is a
  2434.                  check  to alert  you to  each command  found in  a PowerBatch
  2435.                  source  file that  will  be treated  as an  external command.
  2436.                  External  commands are DOS intrinsic commands, .COM, and .EXE
  2437.                  commands or programs  (even PowerBatch compiled programs) and
  2438.                  .BAT  (standard DOS  batch files) that are  to be executed by
  2439.                  PowerBatch.
  2440.  
  2441.                  Example:
  2442.                     External command > 12 DIR     (DOS directory command)
  2443.                     External command > 29 MYPROG  (Executable module MYPROG)
  2444.  
  2445.  
  2446.  
  2447.  
  2448.  
  2449.  
  2450.  
  2451.             Page 45                     PowerBatch                     Page 45
  2452.  
  2453.                            Removing PowerBatch From Your System
  2454.  
  2455.             While  we  believe  that  PowerBatch  is  a  batch  compiler  that
  2456.             everyone should own, we recognize that there are some who feel  it
  2457.             is not a  program they will use on  a regular basis. For those  of
  2458.             you in that minority,  we have provided a program to easily remove
  2459.             all PowerBatch modules  from your  system. To  remove all  modules
  2460.             from  your system  that were  supplied on  the  PowerBatch install
  2461.             disk, enter
  2462.  
  2463.               DELETEPB <enter>
  2464.  
  2465.             You  will be asked  if you wish  to remove  all PowerBatch modules
  2466.             from  the  currently logged  disk. If  this is  the correct  disk,
  2467.             enter Y. If it is  not the correct disk, enter  N and the  program
  2468.             will  terminate. (You  should  move  to  the disk  containing  the
  2469.             PowerBatch  modules.)  You  will next  be  asked  if you  wish  to
  2470.             confirm  each deletion. If you reply (Y)es, each time a PowerBatch
  2471.             module is found,  you will  be asked  if you  wish to delete  this
  2472.             module. If  you reply (N)o,  the modules will  be deleted as  they
  2473.             are found without your intervention.
  2474.  
  2475.  
  2476.  
  2477.  
  2478.  
  2479.  
  2480.  
  2481.             Page 46                     PowerBatch                     Page 46
  2482.  
  2483.                                          Examples
  2484.  
  2485.             The source for several examples is  contained on your installation
  2486.             disk. You may print these examples by entering:
  2487.  
  2488.               COPY DEMO1.PWR LPT1
  2489.  
  2490.             These  examples may  be  compiled using  the  POWERMAK  command by
  2491.             entering:
  2492.  
  2493.               POWERMAK DEMO1 <enter>
  2494.  
  2495.  
  2496.  
  2497.  
  2498.  
  2499.  
  2500.  
  2501.             Page 47                     PowerBatch                     Page 47
  2502.  
  2503.                                         Appendix A
  2504.  
  2505.  
  2506.                            Dealer and Site License Information
  2507.  
  2508.             Site License Pricing
  2509.             A site license is issued  when you wish to receive one master copy
  2510.             of  PowerBatch and duplication is controlled by you. If you obtain
  2511.             a  site  license,  support will  be  provided  to  one  designated
  2512.             contact within your company.
  2513.  
  2514.             Quantity         Price
  2515.               4 - 10      $18 per copy
  2516.              11 - 50      $15 per copy
  2517.              51 - 100     $900
  2518.             101 - 250     $1750
  2519.             251 - 1000    $5000
  2520.  
  2521.             Contact CSD, Inc. for site license pricing for usage above 1000
  2522.  
  2523.             Dealer Pricing
  2524.             Dealer   pricing  is  obtained  by  ordering  multiple  copies  of
  2525.             PowerBatch  on one  order. Multiple complete  copies of PowerBatch
  2526.             are  delivered and  multiple  registrations accepted.  Support  is
  2527.             provided to each registrant.
  2528.  
  2529.             Quantity         Price
  2530.               2 - 5    $23 per copy
  2531.               6 - 10      $21 per copy
  2532.              11 - 25      $19 per copy
  2533.              26 - 50      $17.50 per copy
  2534.              51 - 100     $15 per copy
  2535.  
  2536.             Contact CSD, Inc. for pricing on quantities in excess of 100
  2537.  
  2538.  
  2539.  
  2540.  
  2541.  
  2542.  
  2543.  
  2544.             Page 48                     PowerBatch                     Page 48
  2545.  
  2546.                                         Appendix B
  2547.  
  2548.                                   Composite Color Values
  2549.  
  2550.                                        Color Names
  2551.                                        -----------
  2552.             Name       Value  Name       Value  Name       Value
  2553.             ---------   ---   ----------  ---   ----------  ---
  2554.             Black        0    Brown        6    Lt.Cyan     11
  2555.             Blue         1    Lt.Gray      7    Lt.Red      12
  2556.             Green        2    Dk.Gray      8    Lt.Magenta  13
  2557.             Cyan         3    Lt.Blue      9    Yellow      14
  2558.             Red          4    Lt.Green    10    White       15
  2559.             Magenta      5
  2560.  
  2561.                                 Foreground Colors (0 - 15)
  2562.  
  2563.                                Normal (non-blinking) Colors
  2564.             Bkg0   1   2   3   4   5   6  7   8   9   10 11  12  13  14  15
  2565.               --- --- --- --- --- --- ------ --- --- --- --- --- --- ------
  2566.             0  0   1   2   3   4   5   6  7   8   9   10 11  12  13  14  15
  2567.             1  16  17  18 19  20  21  22  23  24  25  26 27  28  29  30  31
  2568.             2  32  33  34 35  36  37  38  39  40  41  42 43  44  45  46  47
  2569.             3  48  49  50 51  52  53  54  55  56  57  58 59  60  61  62  63
  2570.             4  64  65  66 67  68  69  70  71  72  73  74 75  76  77  78  79
  2571.             5  80  81  82 83  84  85  86  87  88  89  90 91  92  93  94  95
  2572.             6  96  97  98 99  100 101 102103 104 105 106 107 108 109 110111
  2573.             7 112 113 114 115 116 117 118119 120 121 122 123 124 125 126127
  2574.  
  2575.                                     Colors Which Blink
  2576.                0   1   2   3   4   5   6  7   8   9   10 11  12  13  14  15
  2577.               --- --- --- --- --- --- ------ --- --- --- --- --- --- ------
  2578.             0 128 129 130 131 132 133 134135 136 137 138 139 140 141 142143
  2579.             1 144 145 146 147 148 149 150151 152 153 154 155 156 157 158159
  2580.             2 160 161 162 163 164 165 166167 168 169 170 171 172 173 174175
  2581.             3 176 177 178 179 180 181 182183 184 185 186 187 188 189 190191
  2582.             4 192 193 194 195 196 197 198199 200 201 202 203 204 205 206207
  2583.             5 208 209 210 211 212 213 214215 216 217 218 219 220 221 222223
  2584.             6 224 225 226 227 228 229 230231 232 233 234 235 236 237 238239
  2585.             7 240 241 242 243 244 245 246247 248 249 250 251 252 253 254255
  2586.  
  2587.             To find  the  composite  color attribute  for a  particular  color
  2588.             combination,  select  the background  color (0  - 7)  and then  go
  2589.             across under the  foreground color (0  - 15) colums until  you are
  2590.             under  the selected  foreground color  column. The  number at  the
  2591.             intersection  of  these two  color combinations  is the  composite
  2592.             color.  For example if  you wish to have yellow  letters on a blue
  2593.             background,  go down the background  lines to the blue line (color
  2594.             = 1)  and go  across to the  yellow column  (color =  14). At  the
  2595.             intersection  of  these two  lines  and columns  read  30 for  the
  2596.             composite color.
  2597.  
  2598.  
  2599.  
  2600.  
  2601.  
  2602.  
  2603.  
  2604.             Page 49                     PowerBatch                     Page 49
  2605.  
  2606.                                           Index
  2607.  
  2608.      ASP  1                                    ?TIME  23
  2609.      Box  25                                   ADD  24
  2610.      Case                                      BEEP  24
  2611.            lower  31                           BLINK  25
  2612.            upper  33, 35                       BOOT  25
  2613.      Color attribute  18, 19, 32               BOX  25
  2614.      Command line parameters  36               BREAKOFF  26
  2615.      Command Summary  40                       BREAKON  26
  2616.      Command Syntax  19                        CENTER  26
  2617.      Comments  12                              CLEAR  27
  2618.      Compare                                   CLEARBOX  27
  2619.            alphabetic  29                      CLEARLINE  27
  2620.            numeric  29                         COLOR  28
  2621.      Compilation Errors  42                    COMPARE  28
  2622.      Concatenate  30                           CONCAT  30
  2623.      Concept Of Operation  7                   GOTO  30
  2624.      Copyright  1                              GOTOXY  30
  2625.      Ctrl - Break  26                          HALT  31
  2626.      Current date  20                          LABEL  31
  2627.      Current time  23                          LENGTH  31
  2628.      Cursor  30                                LOWER  31
  2629.      Directory  21                             MIDSTRING  32
  2630.      Disk capacity  21                         NORMAL  32
  2631.      Disk free space  21                       PROMPT  32
  2632.      DOS errorlevel  31                        READKEY  32
  2633.      DOS search path  23                       READSTR  33
  2634.      DOSERROR  13, 16                          READUPKEY  33
  2635.      Environment variable  22                  READYN  34
  2636.      ERRORLEVEL  13, 16, 31                    REVERSE  34
  2637.      External command  15, 43                  SETENV  34
  2638.      Field length                              SETPATH  35
  2639.            maximum  33, 36                     SETVAR  35
  2640.      File exists  23                           SUBTRACT  35
  2641.      Frame  25                                 UPPER  35
  2642.      Installation  9                           VARIABLE  36
  2643.      Interior of a box  27                     WAIT  36
  2644.      Introduction  1                           WRITE  37
  2645.      Literals  12, 13                          WRITEAT  37
  2646.      Pause  36                                 WRITELINE  37
  2647.      POWERBAT.ERR  42                      POWERMAK  11
  2648.      PowerBatch Commands  12               Registration  1
  2649.            ?COLOR  19                      Registration Fees  5
  2650.            ?CURRDIR  20                    Removing PowerBatch From Your
  2651.            ?DATE  20                               System  44
  2652.            ?DIREXIST  21                   Screen clear  27
  2653.            ?DISKSPACE  21                  Shareware  1
  2654.            ?DRIVEEXIST  22                 Software Support  6
  2655.            ?ENVSTR  22                     String length  31
  2656.            ?FILEEXIST  23                  Substring  32
  2657.            ?INPATH  23                     System speaker  24
  2658.  
  2659.  
  2660.  
  2661.  
  2662.  
  2663.  
  2664.  
  2665.             Page 50                     PowerBatch                     Page 50
  2666.  
  2667.      Valid drive  22
  2668.      Value
  2669.            initial  36
  2670.      Variable  12
  2671.            value  35
  2672.      Variable map  11
  2673.      Warranty  5
  2674.      What You Get  5
  2675.